This should fix Bug 44148, a regression caused by e2c73fc394ba.
Signed-off-by: Andrew Eikum aeikum@codeweavers.com --- dlls/xaudio2_7/xaudio_dll.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index 8f15ded023..bc5cf1cae9 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -2286,13 +2286,14 @@ static void update_source_state(XA2SourceImpl *src) src->first_al_buf %= XAUDIO2_MAX_QUEUED_BUFFERS; src->al_bufs_used -= processed;
- if(processed > src->abandoned_albufs){ - for(i = src->abandoned_albufs; i < processed; ++i){ - ALint bufsize; + for(i = 0; i < processed; ++i){ + ALint bufsize;
- alGetBufferi(al_buffers[i], AL_SIZE, &bufsize); + alGetBufferi(al_buffers[i], AL_SIZE, &bufsize);
- src->in_al_bytes -= bufsize; + src->in_al_bytes -= bufsize; + + if(src->abandoned_albufs == 0){ src->played_frames += bufsize / src->submit_blocksize;
if(al_buffers[i] == src->buffers[src->first_buf].latest_al_buf){ @@ -2318,11 +2319,10 @@ static void update_source_state(XA2SourceImpl *src) src->buffers[src->first_buf].xa2buffer.pContext); } } + }else{ + src->abandoned_albufs--; } - - src->abandoned_albufs = 0; - }else - src->abandoned_albufs -= processed; + } }
if(!src->running)