From b764e25f5a227ab38ae3980578aa090a561f1fca Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Wed, 26 Aug 2009 20:23:46 +0200 Subject: Fix problem in EsounD processing loops which can result in lockups. --- audio/esdaudio.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'audio') 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; -- cgit v1.1