Commit 2b7e0168 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

audiounit_ios: try to handle data drops more efficiently

Needs mooar testing
parent 161a58b4
...@@ -392,9 +392,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj, ...@@ -392,9 +392,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) {
/* return an empty buffer so silence is played until we have data */ /* bail out and restart unit the next time we receive some data */
for (UInt32 j = 0; j < inNumberFrames; j++) Flush(p_aout, false);
targetBuffer[j] = 0.;
} 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