[vlc-devel] [PATCH 04/16] video_output: express late frame threshold as the frame duration divided by 2

Steve Lhomme robux4 at ycbcr.xyz
Fri Oct 16 16:26:35 CEST 2020


Rather than something looking like a delay.
---
 src/video_output/video_output.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index d970ddae9fe..b3cecff36d1 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1098,8 +1098,10 @@ static int ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reuse_decod
                         late = system_now - system_pts;
 
                     vlc_tick_t late_threshold;
-                    if (decoded->format.i_frame_rate && decoded->format.i_frame_rate_base)
-                        late_threshold = VLC_TICK_FROM_MS(500) * decoded->format.i_frame_rate_base / decoded->format.i_frame_rate;
+                    if (decoded->format.i_frame_rate && decoded->format.i_frame_rate_base) {
+                        late_threshold = vlc_tick_from_samples(decoded->format.i_frame_rate_base, decoded->format.i_frame_rate);
+                        late_threshold /=  2;
+                    }
                     else
                         late_threshold = VOUT_DISPLAY_LATE_THRESHOLD;
                     if (late > late_threshold) {
-- 
2.26.2



More information about the vlc-devel mailing list