src/multimedia/audio/qaudiooutput_alsa_p.cpp
changeset 22 79de32ba3296
parent 19 fcece45ef507
child 23 89e065397ea6
equal deleted inserted replaced
19:fcece45ef507 22:79de32ba3296
   483     return true;
   483     return true;
   484 }
   484 }
   485 
   485 
   486 void QAudioOutputPrivate::close()
   486 void QAudioOutputPrivate::close()
   487 {
   487 {
   488     deviceState = QAudio::StoppedState;
       
   489     timer->stop();
   488     timer->stop();
   490 
   489 
   491     if ( handle ) {
   490     if ( handle ) {
   492         snd_pcm_drain( handle );
   491         snd_pcm_drain( handle );
   493         snd_pcm_close( handle );
   492         snd_pcm_close( handle );
   699                 }
   698                 }
   700             }
   699             }
   701 
   700 
   702         } else if(l < 0) {
   701         } else if(l < 0) {
   703             close();
   702             close();
       
   703             deviceState = QAudio::StoppedState;
   704             errorState = QAudio::IOError;
   704             errorState = QAudio::IOError;
   705             emit stateChanged(deviceState);
   705             emit stateChanged(deviceState);
   706         }
   706         }
   707     } else {
   707     } else {
   708         bytesAvailable = bytesFree();
   708         bytesAvailable = bytesFree();