diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-10-03 23:38:19 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-10-03 23:43:07 +0200 |
commit | 683e212a779341a7b376fbb6d5df54cb8205893d (patch) | |
tree | a0daa85d14857aeead90e6c1d4d0d262ac7cb8eb /audio | |
parent | 32894736780ea63e5fea456de27650fc27ec57c6 (diff) | |
download | mpv-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
Diffstat (limited to 'audio')
-rw-r--r-- | audio/out/ao_coreaudio.c | 1 |
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); } |