[vlc-commits] coreaudio: fix invalid delay after a unpause
Thomas Guillem
git at videolan.org
Sun May 24 21:05:56 CEST 2020
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May 22 20:26:02 2020 +0200| [f507868d1c7cf616e7bfeb4699429f0cee9e574b] | 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
(cherry picked from commit f9fce13591bf3f99c4d9401fe3ba67fb30b0fb75)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=f507868d1c7cf616e7bfeb4699429f0cee9e574b
---
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 df06a36091..69fd471370 100644
--- a/modules/audio_output/coreaudio_common.c
+++ b/modules/audio_output/coreaudio_common.c
@@ -155,7 +155,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