-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 4c07b3a..226f058 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -300,27 +300,24 @@ bool VMemo::startRecording() { if(useAlerts) { msgLabel = new QLabel( 0, "alertLabel" ); msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); msgLabel->show(); } qDebug("Start recording engines"); recording = TRUE; if (openDSP() == -1) { recording = FALSE; - msgLabel=0; - delete msgLabel; - return FALSE; } config.setGroup("Defaults"); QDateTime dt = QDateTime::currentDateTime(); QString fName; config.setGroup( "System" ); fName = QPEApplication::documentDir() ; fileName = config.readEntry("RecLocation", fName); @@ -418,26 +415,30 @@ int VMemo::openDSP() { } qDebug("samplerate: %d, channels %d, resolution %d", speed, channels, resolution); if(systemZaurus) { dsp = open("/dev/dsp1", O_RDONLY); //Zaurus needs /dev/dsp1 channels=1; //zaurus has one input channel } else { dsp = open("/dev/dsp", O_RDONLY); } if(dsp == -1) { - perror("open(\"/dev/dsp\")"); - errorMsg="open(\"/dev/dsp\")\n "+(QString)strerror(errno); + msgLabel->close(); + msgLabel=0; + delete msgLabel; + + perror("open(\"/dev/dsp\")"); + errorMsg="open(\"/dev/dsp\")\n "+(QString)strerror(errno); QMessageBox::critical(0, "vmemo", errorMsg, "Abort"); return -1; } if(ioctl(dsp, SNDCTL_DSP_SETFMT , &format)==-1) { perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); return -1; } if(ioctl(dsp, SNDCTL_DSP_CHANNELS , &channels)==-1) { perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); return -1; } |