Commit ace3c315 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

dsound: Don't change play position if IAudioClient methods fail.

parent f53dd40a
...@@ -605,8 +605,6 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) ...@@ -605,8 +605,6 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force)
if(!prebuf_bytes) if(!prebuf_bytes)
return; return;
device->in_mmdev_bytes += prebuf_bytes;
if(prebuf_bytes + read_offs_bytes > device->buflen){ if(prebuf_bytes + read_offs_bytes > device->buflen){
DWORD chunk_bytes = device->buflen - read_offs_bytes; DWORD chunk_bytes = device->buflen - read_offs_bytes;
prebuf_frames = chunk_bytes / device->pwfx->nBlockAlign; prebuf_frames = chunk_bytes / device->pwfx->nBlockAlign;
...@@ -631,6 +629,8 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) ...@@ -631,6 +629,8 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force)
return; return;
} }
device->in_mmdev_bytes += prebuf_frames * device->pwfx->nBlockAlign;
/* check if anything wrapped */ /* check if anything wrapped */
if(prebuf_bytes > 0){ if(prebuf_bytes > 0){
prebuf_frames = prebuf_bytes / device->pwfx->nBlockAlign; prebuf_frames = prebuf_bytes / device->pwfx->nBlockAlign;
...@@ -648,6 +648,7 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force) ...@@ -648,6 +648,7 @@ static void DSOUND_WaveQueue(DirectSoundDevice *device, BOOL force)
WARN("ReleaseBuffer failed: %08x\n", hr); WARN("ReleaseBuffer failed: %08x\n", hr);
return; return;
} }
device->in_mmdev_bytes += prebuf_frames * device->pwfx->nBlockAlign;
} }
TRACE("in_mmdev_bytes now = %i\n", device->in_mmdev_bytes); TRACE("in_mmdev_bytes now = %i\n", device->in_mmdev_bytes);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment