]> git.sesse.net Git - vlc/commitdiff
Revert "audiounit_ios: try to handle data drops more efficiently"
authorMartin Storsjö <martin@martin.st>
Tue, 23 Jul 2013 13:39:30 +0000 (16:39 +0300)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 28 Jul 2013 16:38:06 +0000 (18:38 +0200)
This (more or less) reverts commit
2b7e016807507b632b8e0a7c874030bdffb2f604.

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 <fkuehne@videolan.org>
modules/audio_output/audiounit_ios.c

index 1faaf589e9afe357cddab06e7982faea565bef2f..974d172b9bf8942d020628d30ae9e6bb064797f8 100644 (file)
@@ -383,8 +383,8 @@ static OSStatus RenderCallback(vlc_object_t *p_obj,
 
     /* check if we have enough data */
     if (!availableBytes) {
-        /* bail out and restart unit the next time we receive some data */
-        Flush(p_aout, false);
+        /* return an empty buffer so silence is played until we have data */
+        memset(targetBuffer, 0, bytesToCopy);
     } else {
         memcpy(targetBuffer, buffer, __MIN(bytesToCopy, availableBytes));
         TPCircularBufferConsume(&p_sys->circular_buffer, __MIN(bytesToCopy, availableBytes));