Added check to alsa backend for QAudioOutput

- Was asserting when stop() called when in IdleState

Change-Id: Ib8a5bd149c0b9c700c709520cf8ffdd237e08694
Reviewed-by: Ling Hu <ling.hu@nokia.com>
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
This commit is contained in:
Kurt Korbatits
2012-07-25 12:28:23 +10:00
committed by Qt by Nokia
parent a646db3ef6
commit 64dbf9d968

View File

@@ -747,6 +747,11 @@ bool QAudioOutputPrivate::deviceReady()
if(input > (int)buffer_frames)
input = buffer_frames;
l = audioSource->read(audioBuffer,snd_pcm_frames_to_bytes(handle, input));
// reading can take a while and stream may have been stopped
if (!handle)
return false;
if(l > 0) {
// Got some data to output
if(deviceState != QAudio::ActiveState)