[vlc-commits] filter_chain: use an empty callback owner for intermediate filters

Steve Lhomme git at videolan.org
Wed Sep 18 09:06:21 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jul 25 12:11:07 2019 +0200| [0f2ef8de0bbddae05dc55b7a814f64bf1b8c0c61] | committer: Steve Lhomme

filter_chain: use an empty callback owner for intermediate filters

This way we can use filter_NewPicture() which will use the allocator of
the filter if there is one.

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

 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 d759941a8d..d0b08fc69e 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 );
+        filter_owner_t saved_owner = filter->owner;
+        filter->owner = (filter_owner_t) {};
+        pic = filter_NewPicture( filter );
+        filter->owner = saved_owner;
         if( pic == NULL )
             msg_Err( filter, "Failed to allocate picture" );
     }



More information about the vlc-commits mailing list