[vlc-commits] coreaudio: fix possible freeze after pause, seek, unpause

Thomas Guillem git at videolan.org
Thu Jun 25 11:15:02 CEST 2020


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jun 23 16:25:36 2020 +0200| [6532618a6c4f35fbc08293f791d93cfd6cc80c8a] | committer: Thomas Guillem

coreaudio: fix possible freeze after pause, seek, unpause

After a flush, i_first_render_host_time is reset to 0 and i_render_host_time
should not be touched since the playback has not started again yet. This caused
the i_first_render_host_time to be never setup.

Regression from f507868d1c7cf616e7bfeb4699429f0cee9e574b
Fixes #24876

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

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

 modules/audio_output/coreaudio_common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/coreaudio_common.c b/modules/audio_output/coreaudio_common.c
index 69fd471370..de3a9717a7 100644
--- a/modules/audio_output/coreaudio_common.c
+++ b/modules/audio_output/coreaudio_common.c
@@ -155,15 +155,15 @@ ca_Render(audio_output_t *p_aout, uint32_t i_frames, uint64_t i_host_time,
         vlc_sem_post(&p_sys->flush_sem);
     }
 
+    if (unlikely(p_sys->i_first_render_host_time == 0))
+        goto drop;
+
     if (p_sys->b_paused)
     {
         p_sys->i_render_host_time = i_host_time;
         goto drop;
     }
 
-    if (unlikely(p_sys->i_first_render_host_time == 0))
-        goto drop;
-
     /* Start deferred: write silence (zeros) until we reach the first render
      * host time. */
     if (unlikely(p_sys->i_first_render_host_time > i_host_time ))



More information about the vlc-commits mailing list