[vlc-devel] [PATCH v2 07/20] fps: only set the start date if there wasn't one set

Steve Lhomme robux4 at ycbcr.xyz
Wed Oct 14 14:39:07 CEST 2020


If pictures are far in the future without a flush we fill the gap with extra
pictures according to the "framerate" tick.

Otherwise that code was never called since the condition to reset the clock was
the same used to produce extra pictures.
---
 modules/video_filter/fps.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/modules/video_filter/fps.c b/modules/video_filter/fps.c
index 5f072aa7040..67c1bd86e23 100644
--- a/modules/video_filter/fps.c
+++ b/modules/video_filter/fps.c
@@ -90,21 +90,18 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_picture)
 
     /* First time we get some valid timestamp, we'll take it as base for output
         later on we retake new timestamp if it has jumped too much */
-    if( unlikely( ( date_Get( &p_sys->next_output_pts ) == VLC_TICK_INVALID ) ||
-                   ( src_date > ( date_Get( &p_sys->next_output_pts ) + p_sys->i_output_frame_interval ) )
-                ) )
+    if( unlikely( date_Get( &p_sys->next_output_pts ) == VLC_TICK_INVALID ) )
     {
         msg_Dbg( p_filter, "Resetting timestamps" );
         date_Set( &p_sys->next_output_pts, src_date );
         if( p_sys->p_previous_pic )
             picture_Release( p_sys->p_previous_pic );
+        // p_picture will be returned so we need a reference
         p_sys->p_previous_pic = picture_Hold( p_picture );
-        SetOutputDate( p_sys, p_picture );
-        return p_picture;
     }
 
     /* Check if we can skip input as better should follow */
-    if( src_date <
+    else if( src_date <
         ( date_Get( &p_sys->next_output_pts ) - p_sys->i_output_frame_interval ) )
     {
         if( p_sys->p_previous_pic )
-- 
2.26.2



More information about the vlc-devel mailing list