[vlc-commits] audiounit_ios: fix resume from pause

Thomas Guillem git at videolan.org
Wed Jul 25 11:14:15 CEST 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 24 18:28:28 2018 +0200| [9ed50b630ea1fa3a538cbc95357d4c441e1aae9c] | committer: Thomas Guillem

audiounit_ios: fix resume from pause

Fixes #20885

(cherry picked from commit 1ae26b6c257e4e8ffa800a41b3289076240bf8f8)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=9ed50b630ea1fa3a538cbc95357d4c441e1aae9c
---

 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 d11be011af..53c890fc5c 100644
--- a/modules/audio_output/audiounit_ios.m
+++ b/modules/audio_output/audiounit_ios.m
@@ -403,6 +403,14 @@ Pause (audio_output_t *p_aout, bool pause, mtime_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