From ace3c315b891fbfc801ab20303dce08ad1c76e63 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Thu, 21 Nov 2013 12:42:41 -0600 Subject: [PATCH] dsound: Don't change play position if IAudioClient methods fail. --- dlls/dsound/mixer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c index 282808e788a..43b7dcaf069 100644 --- a/dlls/dsound/mixer.c +++ b/dlls/dsound/mixer.c @@ -605,8 +605,6 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) if(!prebuf_bytes) return; - device->in_mmdev_bytes += prebuf_bytes; - if(prebuf_bytes + read_offs_bytes > device->buflen){ DWORD chunk_bytes = device->buflen - read_offs_bytes; prebuf_frames = chunk_bytes / device->pwfx->nBlockAlign; @@ -631,6 +629,8 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) return; } + device->in_mmdev_bytes += prebuf_frames * device->pwfx->nBlockAlign; + /* check if anything wrapped */ if(prebuf_bytes > 0){ prebuf_frames = prebuf_bytes / device->pwfx->nBlockAlign; @@ -648,6 +648,7 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) WARN("ReleaseBuffer failed: %08x\n", hr); return; } + device->in_mmdev_bytes += prebuf_frames * device->pwfx->nBlockAlign; } TRACE("in_mmdev_bytes now = %i\n", device->in_mmdev_bytes); -- 2.11.4.GIT