[vlc-devel] [PATCH 14/14] filter_chain: use an empty callback owner for intermediate filters

Steve Lhomme robux4 at ycbcr.xyz
Thu Jul 25 12:34:13 CEST 2019


This way we can use filter_NewPicture() which will use the allocator of
the filter if there is one.
---
 src/misc/filter_chain.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index d4652ebf93..450aa4355d 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -102,7 +102,10 @@ static picture_t *filter_chain_VideoBufferNew( filter_t *filter )
     {
         // HACK as intermediate filters may not have the same video format as
         // the last one handled by the owner
-        pic = picture_NewFromFormat( &filter->fmt_out.video );
+        video_filter_owner_t saved_owner = filter->video_owner;
+        filter->video_owner = (video_filter_owner_t) {};
+        pic = filter_NewPicture( filter );
+        filter->video_owner = saved_owner;
         if( pic == NULL )
             msg_Err( filter, "Failed to allocate picture" );
     }
-- 
2.17.1



More information about the vlc-devel mailing list