summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-10-03 23:38:19 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-10-03 23:43:07 +0200
commit683e212a779341a7b376fbb6d5df54cb8205893d (patch)
treea0daa85d14857aeead90e6c1d4d0d262ac7cb8eb
parent32894736780ea63e5fea456de27650fc27ec57c6 (diff)
downloadmpv-683e212a779341a7b376fbb6d5df54cb8205893d.tar.bz2
mpv-683e212a779341a7b376fbb6d5df54cb8205893d.tar.xz
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
-rw-r--r--audio/out/ao_coreaudio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c
index cba0900973..878d92b0af 100644
--- a/audio/out/ao_coreaudio.c
+++ b/audio/out/ao_coreaudio.c
@@ -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);
}