[vlc-devel] [PATCH 10/16] video_output: check for paused state in the clock even when not dropping frames
Steve Lhomme
robux4 at ycbcr.xyz
Fri Oct 16 16:26:41 CEST 2020
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.
---
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 ede7a2ed242..3b3c8e36bd1 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1064,7 +1064,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);
@@ -1079,23 +1079,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) {
--
2.26.2
More information about the vlc-devel
mailing list