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:
Stefano Pigozzi 2013-10-03 23:38:19 +02:00
parent 3289473678
commit 683e212a77
1 changed files with 1 additions and 0 deletions

View File

@ -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);
}