[vlc-commits] fps: use vlc_picture_chain_AppendChain for chained pictures

Steve Lhomme git at videolan.org
Mon Oct 12 15:55:40 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Oct  6 16:05:16 2020 +0200| [962a848d10f4aab1d96605a43a23678ba1cb14f3] | committer: Steve Lhomme

fps: use vlc_picture_chain_AppendChain for chained pictures

Partially reverts 50773e2028986549fa8dbf804f8fbb29adcd46ce.

We should never access vlc_picture_chain_t::front directly.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=962a848d10f4aab1d96605a43a23678ba1cb14f3
---

 modules/video_filter/fps.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/video_filter/fps.c b/modules/video_filter/fps.c
index 312e0eba91..03c564058b 100644
--- a/modules/video_filter/fps.c
+++ b/modules/video_filter/fps.c
@@ -111,9 +111,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_picture)
     p_sys->p_previous_pic->date = date_Get( &p_sys->next_output_pts );
     date_Increment( &p_sys->next_output_pts, 1 );
 
-    vlc_picture_chain_t chain;
-    vlc_picture_chain_Init( &chain );
-    vlc_picture_chain_Append( &chain, p_sys->p_previous_pic );
+    picture_t *last_pic = p_sys->p_previous_pic;
     /* Duplicating pictures are not that effective and framerate increase
         should be avoided, it's only here as filter should work in that direction too*/
     while( unlikely( (date_Get( &p_sys->next_output_pts ) + p_sys->i_output_frame_interval ) < p_picture->date ) )
@@ -124,12 +122,14 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_picture)
         picture_Copy( p_tmp, p_sys->p_previous_pic);
         p_tmp->date = date_Get( &p_sys->next_output_pts );
 
-        vlc_picture_chain_Append( &chain, p_tmp );
+        vlc_picture_chain_AppendChain( last_pic, p_tmp );
+        last_pic = p_tmp;
         date_Increment( &p_sys->next_output_pts, 1 );
     }
 
+    last_pic = p_sys->p_previous_pic;
     p_sys->p_previous_pic = p_picture;
-    return chain.front;
+    return last_pic;
 }
 
 static const struct vlc_filter_operations filter_ops =



More information about the vlc-commits mailing list