]> git.sesse.net Git - vlc/commitdiff
audiounit_ios: try to handle data drops more efficiently
authorFelix Paul Kühne <fkuehne@videolan.org>
Mon, 1 Apr 2013 14:54:57 +0000 (16:54 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 4 Apr 2013 17:36:08 +0000 (19:36 +0200)
Needs mooar testing

modules/audio_output/audiounit_ios.c

index 24e12668c3b1b4d58be0b6d7463c89004b5331f8..a4af9d20af362cbe7ff1367e6b102ba8a0d9d30c 100644 (file)
@@ -392,9 +392,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
 
     /* check if we have enough data */
     if (!availableBytes) {
-        /* return an empty buffer so silence is played until we have data */
-        for (UInt32 j = 0; j < inNumberFrames; j++)
-            targetBuffer[j] = 0.;
+        /* bail out and restart unit the next time we receive some data */
+        Flush(p_aout, false);
     } else {
         memcpy(targetBuffer, buffer, __MIN(bytesToCopy, availableBytes));
         TPCircularBufferConsume(&p_sys->circular_buffer, __MIN(bytesToCopy, availableBytes));