xaudio2: Account for abandoned buffer bytes.
This should fix bug 44148, a regression caused by e2c73fc394
.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
eaca5e023e
commit
f57246e5e5
|
@ -2286,13 +2286,14 @@ static void update_source_state(XA2SourceImpl *src)
|
||||||
src->first_al_buf %= XAUDIO2_MAX_QUEUED_BUFFERS;
|
src->first_al_buf %= XAUDIO2_MAX_QUEUED_BUFFERS;
|
||||||
src->al_bufs_used -= processed;
|
src->al_bufs_used -= processed;
|
||||||
|
|
||||||
if(processed > src->abandoned_albufs){
|
for(i = 0; i < processed; ++i){
|
||||||
for(i = src->abandoned_albufs; i < processed; ++i){
|
ALint bufsize;
|
||||||
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;
|
src->played_frames += bufsize / src->submit_blocksize;
|
||||||
|
|
||||||
if(al_buffers[i] == src->buffers[src->first_buf].latest_al_buf){
|
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);
|
src->buffers[src->first_buf].xa2buffer.pContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
src->abandoned_albufs--;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
src->abandoned_albufs = 0;
|
|
||||||
}else
|
|
||||||
src->abandoned_albufs -= processed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!src->running)
|
if(!src->running)
|
||||||
|
|
Loading…
Reference in New Issue