[vlc-commits] audiounit_ios: fix resume from pause

Thomas Guillem git at videolan.org
Wed Jul 25 11:12:58 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 24 18:28:28 2018 +0200| [1ae26b6c257e4e8ffa800a41b3289076240bf8f8] | committer: Thomas Guillem

audiounit_ios: fix resume from pause

Fixes #20885

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1ae26b6c257e4e8ffa800a41b3289076240bf8f8
---

 modules/audio_output/audiounit_ios.m | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/audio_output/audiounit_ios.m b/modules/audio_output/audiounit_ios.m
index aca7c44de8..e449f6e2eb 100644
--- a/modules/audio_output/audiounit_ios.m
+++ b/modules/audio_output/audiounit_ios.m
@@ -402,6 +402,14 @@ Pause (audio_output_t *p_aout, bool pause, vlc_tick_t date)
     }
     p_sys->b_stopped = pause;
     ca_Pause(p_aout, pause, date);
+
+    /* Since we stopped the AudioUnit, we can't really recover the delay from
+     * the last playback. So it's better to flush everything now to avoid
+     * synchronization glitches when resuming from pause. The main drawback is
+     * that we loose 1-2 sec of audio when resuming. The order is important
+     * here, ca_Flush need to be called when paused. */
+    if (pause)
+        ca_Flush(p_aout, false);
 }
 
 static void



More information about the vlc-commits mailing list