Commit e720aa79 authored by Martin Storsjö's avatar Martin Storsjö Committed by Felix Paul Kühne
Browse files

Revert "audiounit_ios: try to handle data drops more efficiently"

This (more or less) reverts commit


Stopping the aout from within the callback like this could
lead to deadlocks, where AudioOutputUnitStop in the callback thread
and AudioOutputUnitStart in the audio decoder thread blocked each
other (noticed at startup of playback on a 3GS with iOS 6.0).
Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <>
parent 9e7979a2
...@@ -383,8 +383,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj, ...@@ -383,8 +383,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
/* check if we have enough data */ /* check if we have enough data */
if (!availableBytes) { if (!availableBytes) {
/* bail out and restart unit the next time we receive some data */ /* return an empty buffer so silence is played until we have data */
Flush(p_aout, false); memset(targetBuffer, 0, bytesToCopy);
} else { } else {
memcpy(targetBuffer, buffer, __MIN(bytesToCopy, availableBytes)); memcpy(targetBuffer, buffer, __MIN(bytesToCopy, availableBytes));
TPCircularBufferConsume(&p_sys->circular_buffer, __MIN(bytesToCopy, availableBytes)); TPCircularBufferConsume(&p_sys->circular_buffer, __MIN(bytesToCopy, availableBytes));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment