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

Thomas Guillem git at videolan.org
Tue Jun 23 16:33:15 CEST 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jun 23 16:25:36 2020 +0200| [1530679a64f82c8e4fc0ee485ae8b784a203f3f7] | 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 f9fce13591bf3f99c4d9401fe3ba67fb30b0fb75
Fixes #24876

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

 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 70811aaea7..797c3e623d 100644
--- a/modules/audio_output/coreaudio_common.c
+++ b/modules/audio_output/coreaudio_common.c
@@ -139,15 +139,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