diff options
author | David 'Digit' Turner <digit@google.com> | 2009-08-26 20:23:46 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2009-08-26 20:23:46 +0200 |
commit | b764e25f5a227ab38ae3980578aa090a561f1fca (patch) | |
tree | b4f096b3c56b782097afff4de1ecf63069566838 /audio | |
parent | b4ab1dddf1beed0d636443053b146b72710e821a (diff) | |
download | external_qemu-b764e25f5a227ab38ae3980578aa090a561f1fca.zip external_qemu-b764e25f5a227ab38ae3980578aa090a561f1fca.tar.gz external_qemu-b764e25f5a227ab38ae3980578aa090a561f1fca.tar.bz2 |
Fix problem in EsounD processing loops which can result in lockups.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/esdaudio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/audio/esdaudio.c b/audio/esdaudio.c index 033d3bc..a06176e 100644 --- a/audio/esdaudio.c +++ b/audio/esdaudio.c @@ -137,6 +137,8 @@ static int qesd_run_out (HWVoiceOut *hw) O("EsounD output thread write error: %s", strerror(errno)); break; } + if (nwrite == 0) + break; writeSamples = nwrite >> hw->info.shift; writeBytes = writeSamples << hw->info.shift; @@ -288,6 +290,8 @@ static int qesd_run_in (HWVoiceIn *hw) qesd_logerr (errno, "read failed: %s\n", strerror(errno)); break; } + if (nread == 0) + break; readSamples = nread >> hw->info.shift; readBytes = readSamples << hw->info.shift; |