[vlc-commits] audiounit_ios: don't call AudioOutputUnitStop twice

Thomas Guillem git at videolan.org
Thu Sep 14 11:12:08 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Sep 14 11:09:14 2017 +0200| [129125bc90009e8b4849ddcb101c5fd88dbe53d4] | committer: Thomas Guillem

audiounit_ios: don't call AudioOutputUnitStop twice

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

 modules/audio_output/audiounit_ios.m | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/audiounit_ios.m b/modules/audio_output/audiounit_ios.m
index e90e3752d7..a53a15f93d 100644
--- a/modules/audio_output/audiounit_ios.m
+++ b/modules/audio_output/audiounit_ios.m
@@ -298,6 +298,9 @@ Pause (audio_output_t *p_aout, bool pause, mtime_t date)
      * multi-tasking, the multi-tasking view would still show a playing state
      * despite we are paused, same for lock screen */
 
+    if (pause == p_sys->b_paused)
+        return;
+
     OSStatus err;
     if (pause)
     {
@@ -314,6 +317,7 @@ Pause (audio_output_t *p_aout, bool pause, mtime_t date)
             if (err != noErr)
             {
                 ca_LogErr("AudioOutputUnitStart failed");
+                avas_SetActive(p_aout, false, 0);
                 /* Do not un-pause, the Render Callback won't run, and next call
                  * of ca_Play will deadlock */
                 return;
@@ -377,9 +381,12 @@ Stop(audio_output_t *p_aout)
 
     [[NSNotificationCenter defaultCenter] removeObserver:p_sys->aoutWrapper];
 
-    err = AudioOutputUnitStop(p_sys->au_unit);
-    if (err != noErr)
-        ca_LogWarn("AudioOutputUnitStop failed");
+    if (!p_sys->b_paused)
+    {
+        err = AudioOutputUnitStop(p_sys->au_unit);
+        if (err != noErr)
+            ca_LogWarn("AudioOutputUnitStop failed");
+    }
 
     au_Uninitialize(p_aout, p_sys->au_unit);
 



More information about the vlc-commits mailing list