From: munkyu.im Date: Tue, 28 Aug 2012 07:42:06 +0000 (+0900) Subject: audio/winwave: previous audio buffer should be flushed X-Git-Tag: v1.1.2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=256c89943262c4a10f4a1604d73918d37adad24e;p=thirdparty%2Fqemu.git audio/winwave: previous audio buffer should be flushed Winwave audio backend has problem with pausing and restart audio out. Unlike other backends, Winwave pausing API does not flush audio buffer. As a result, the previous audio data are played in front of user expected sound when user restart audio. So changes it to waveOutReset() Signed-off-by: Munkyu Im Signed-off-by: malc (cherry picked from commit 13ef70f64e9e4d7583fbd9918d8ea76194023d37) Signed-off-by: Michael Roth --- diff --git a/audio/winwaveaudio.c b/audio/winwaveaudio.c index 87e7493270e..d4281e7d959 100644 --- a/audio/winwaveaudio.c +++ b/audio/winwaveaudio.c @@ -349,21 +349,15 @@ static int winwave_ctl_out (HWVoiceOut *hw, int cmd, ...) else { hw->poll_mode = 0; } - if (wave->paused) { - mr = waveOutRestart (wave->hwo); - if (mr != MMSYSERR_NOERROR) { - winwave_logerr (mr, "waveOutRestart"); - } - wave->paused = 0; - } + wave->paused = 0; } return 0; case VOICE_DISABLE: if (!wave->paused) { - mr = waveOutPause (wave->hwo); + mr = waveOutReset (wave->hwo); if (mr != MMSYSERR_NOERROR) { - winwave_logerr (mr, "waveOutPause"); + winwave_logerr (mr, "waveOutReset"); } else { wave->paused = 1;