mirror of https://github.com/mpv-player/mpv
ao_coreaudio: clear output buffer on buffer underrun
Output silence to the output buffer during underruns. This removes small occasional glitches that happen before the AUHAL is actually paused from the `audio_pause` call. Fixes #269
This commit is contained in:
parent
3289473678
commit
683e212a77
|
@ -112,6 +112,7 @@ static OSStatus render_cb_lpcm(void *ctx, AudioUnitRenderActionFlags *aflags,
|
|||
if (mp_ring_buffered(p->buffer) < requested) {
|
||||
MP_VERBOSE(ao, "buffer underrun\n");
|
||||
audio_pause(ao);
|
||||
memset(buf.mData, 0, requested);
|
||||
} else {
|
||||
mp_ring_read(p->buffer, buf.mData, requested);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue