[vlc-commits] coreaudio: fix invalid delay after a unpause

Thomas Guillem git at videolan.org
Sun May 24 20:59:50 CEST 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May 22 20:26:02 2020 +0200| [f9fce13591bf3f99c4d9401fe3ba67fb30b0fb75] | committer: Thomas Guillem

coreaudio: fix invalid delay after a unpause

The render host time was not updated while paused.

This caused the first time_get(), after a unpause, to return a delay way too
early (corresponding to the pause time). This could happen only when the ca
render callback was not triggered between an unpause and a time_get.

This invalid delay caused the insertion of a long silence, that was not
interruptible, hence the impression of a deadlock.

Fixes #24668

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

 modules/audio_output/coreaudio_common.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/audio_output/coreaudio_common.c b/modules/audio_output/coreaudio_common.c
index 5f8a633bee..70811aaea7 100644
--- a/modules/audio_output/coreaudio_common.c
+++ b/modules/audio_output/coreaudio_common.c
@@ -139,7 +139,13 @@ ca_Render(audio_output_t *p_aout, uint32_t i_frames, uint64_t i_host_time,
         vlc_sem_post(&p_sys->flush_sem);
     }
 
-    if (p_sys->b_paused || unlikely(p_sys->i_first_render_host_time == 0))
+    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



More information about the vlc-commits mailing list