[vlc-commits] video_output: check for paused state in the clock even when not dropping frames
Steve Lhomme
git at videolan.org
Tue Oct 20 11:03:05 CEST 2020
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Oct 16 12:57:37 2020 +0200| [062c36aec5667faee0ff21d393fcc2217b2fd2a0] | committer: Steve Lhomme
video_output: check for paused state in the clock even when not dropping frames
And only check the "late" value if we can drop frames.
is_late_dropped doesn't need to use the pause state, now they are exclusive.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=062c36aec5667faee0ff21d393fcc2217b2fd2a0
---
src/video_output/video_output.c | 34 ++++++++++++++++------------------
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 3514d6dee8..1008ef83c1 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1065,7 +1065,7 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
bool frame_by_frame, bool *paused)
{
vout_thread_sys_t *sys = vout;
- bool is_late_dropped = sys->is_late_dropped && !sys->pause.is_on && !frame_by_frame;
+ bool is_late_dropped = sys->is_late_dropped && !frame_by_frame;
vlc_mutex_lock(&sys->filter.lock);
@@ -1080,23 +1080,21 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
decoded = picture_fifo_Pop(sys->decoder_fifo);
if (decoded) {
- if (is_late_dropped && !decoded->b_force) {
- const vlc_tick_t system_now = vlc_tick_now();
- const vlc_tick_t system_pts =
- vlc_clock_ConvertToSystem(sys->clock, system_now,
- decoded->date, sys->rate);
-
- vlc_tick_t late;
- if (system_pts == INT64_MAX)
- {
- /* The clock is paused, notify it (so that the current
- * picture is displayed but not the next one), this
- * current picture can't be be late. */
- *paused = true;
- late = 0;
- }
- else
- late = system_now - system_pts;
+ const vlc_tick_t system_now = vlc_tick_now();
+ const vlc_tick_t system_pts =
+ vlc_clock_ConvertToSystem(sys->clock, system_now,
+ decoded->date, sys->rate);
+
+ if (system_pts == INT64_MAX)
+ {
+ /* The clock is paused, notify it (so that the current
+ * picture is displayed but not the next one), this
+ * current picture can't be be late. */
+ *paused = true;
+ }
+ else if (is_late_dropped && !decoded->b_force)
+ {
+ vlc_tick_t late = system_now - system_pts;
vlc_tick_t late_threshold;
if (decoded->format.i_frame_rate && decoded->format.i_frame_rate_base) {
More information about the vlc-commits
mailing list