wineoss.drv: Don't skip over position updates of less than one fragment.
This commit is contained in:
parent
74471e857c
commit
932f392e08
|
@ -1393,7 +1393,7 @@ static void oss_write_data(ACImpl *This)
|
|||
{
|
||||
ssize_t written_bytes;
|
||||
UINT32 written_frames, in_oss_frames, write_limit, max_period, write_offs_frames, new_frames;
|
||||
size_t to_write_frames, to_write_bytes, advanced;
|
||||
SIZE_T to_write_frames, to_write_bytes, advanced;
|
||||
audio_buf_info bi;
|
||||
BYTE *buf;
|
||||
|
||||
|
@ -1409,9 +1409,7 @@ static void oss_write_data(ACImpl *This)
|
|||
bi.bytes, This->oss_bufsize_bytes);
|
||||
This->oss_bufsize_bytes = bi.bytes;
|
||||
in_oss_frames = 0;
|
||||
}else if(This->oss_bufsize_bytes - bi.bytes <= bi.fragsize)
|
||||
in_oss_frames = 0;
|
||||
else
|
||||
}else
|
||||
in_oss_frames = (This->oss_bufsize_bytes - bi.bytes) / This->fmt->nBlockAlign;
|
||||
|
||||
write_limit = 0;
|
||||
|
@ -1433,6 +1431,8 @@ static void oss_write_data(ACImpl *This)
|
|||
This->lcl_offs_frames %= This->bufsize_frames;
|
||||
This->held_frames -= advanced;
|
||||
This->in_oss_frames = in_oss_frames;
|
||||
TRACE("advanced by %lu, lcl_offs: %u, held: %u, in_oss: %u\n",
|
||||
advanced, This->lcl_offs_frames, This->held_frames, This->in_oss_frames);
|
||||
|
||||
|
||||
if(This->held_frames == This->in_oss_frames)
|
||||
|
@ -1448,7 +1448,9 @@ static void oss_write_data(ACImpl *This)
|
|||
|
||||
to_write_frames = min(to_write_frames, write_limit);
|
||||
to_write_bytes = to_write_frames * This->fmt->nBlockAlign;
|
||||
|
||||
TRACE("going to write %lu frames from %u (%lu of %u)\n", to_write_frames,
|
||||
write_offs_frames, to_write_frames + write_offs_frames,
|
||||
This->bufsize_frames);
|
||||
|
||||
buf = This->local_buffer + write_offs_frames * This->fmt->nBlockAlign;
|
||||
|
||||
|
@ -1479,6 +1481,8 @@ static void oss_write_data(ACImpl *This)
|
|||
if(This->session->mute)
|
||||
silence_buffer(This, This->local_buffer, to_write_frames);
|
||||
|
||||
TRACE("wrapping to write %lu frames from beginning\n", to_write_frames);
|
||||
|
||||
written_bytes = write(This->fd, This->local_buffer, to_write_bytes);
|
||||
if(written_bytes < 0){
|
||||
WARN("write failed: %d (%s)\n", errno, strerror(errno));
|
||||
|
|
Loading…
Reference in New Issue