mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
wineoss.drv: Cap reported OSS fill level to expected level.
Some devices apparently return that the buffer contains an extra frame that we never wrote. We should account for that to avoid an integer underflow.
This commit is contained in:
parent
6c073fe9a9
commit
025e6650e4
@ -1412,6 +1412,12 @@ static void oss_write_data(ACImpl *This)
|
||||
}else
|
||||
in_oss_frames = (This->oss_bufsize_bytes - bi.bytes) / This->fmt->nBlockAlign;
|
||||
|
||||
if(in_oss_frames > This->in_oss_frames){
|
||||
TRACE("Capping reported frames from %u to %u\n",
|
||||
in_oss_frames, This->in_oss_frames);
|
||||
in_oss_frames = This->in_oss_frames;
|
||||
}
|
||||
|
||||
write_limit = 0;
|
||||
while(write_limit + in_oss_frames < max_period * 3)
|
||||
write_limit += max_period;
|
||||
|
Loading…
Reference in New Issue
Block a user