[vlc-devel] [PATCH] fps: use vlc_picture_chain_AppendChain for chained pictures
Steve Lhomme
robux4 at ycbcr.xyz
Wed Oct 7 09:16:59 CEST 2020
Partially reverts 50773e2028986549fa8dbf804f8fbb29adcd46ce.
We should never access vlc_picture_chain_t::front directly.
---
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 49b0d3b61c7..76405852a7c 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 int Open( vlc_object_t *p_this)
--
2.26.2
More information about the vlc-devel
mailing list