[vlc-devel] [PATCH 04/21] video_output: count the pictures dropped

Steve Lhomme robux4 at ycbcr.xyz
Tue Sep 15 14:36:09 CEST 2020


---
 src/video_output/video_output.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 32890966dd0..8380406c269 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1472,7 +1472,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
     vout_thread_sys_t *sys = vout;
     bool frame_by_frame = !deadline;
     bool paused = sys->pause.is_on;
-    bool first = !sys->displayed.current;
+    const bool first = !sys->displayed.current;
 
     assert(sys->clock);
 
@@ -1534,6 +1534,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
         {
             const vlc_tick_t date_next = next_system_pts - render_delay;
             if (date_next <= system_now)
+                // the next frame is not in the future, skip the current one
                 drop_next_frame = true;
 
             if (deadline) {
@@ -1551,6 +1552,10 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
 
     if (drop_next_frame) {
         picture_Release(sys->displayed.current);
+        if (first)
+            // we got a current and a next and will only display the next
+            vout_statistic_AddLost(&sys->statistic, 1);
+
         sys->displayed.current = sys->displayed.next;
         sys->displayed.next    = NULL;
     }
-- 
2.26.2



More information about the vlc-devel mailing list