[vlc-devel] [PATCH 13/14] filters: allow the filter owner not to provide pictures

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


In that case the internal allocator of the default allocator are used.
---
 include/vlc_filter.h | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index e6b918d7a4..18b3c66294 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -176,14 +176,17 @@ struct filter_t
  */
 static inline picture_t *filter_NewPicture( filter_t *p_filter )
 {
-    picture_t *pic;
+    picture_t *pic = NULL;
     if ( p_filter->video_owner.video != NULL && p_filter->video_owner.video->buffer_new != NULL)
         pic = p_filter->video_owner.video->buffer_new( p_filter );
-    else if ( p_filter->filter_allocator.buffer_new != NULL )
-        pic = p_filter->filter_allocator.buffer_new( p_filter );
-    else
-        // legacy filter owners not setting a default video_allocator
-        pic = picture_NewFromFormat( &p_filter->fmt_out.video );
+    if ( pic == NULL )
+    {
+        if ( p_filter->filter_allocator.buffer_new != NULL )
+            pic = p_filter->filter_allocator.buffer_new( p_filter );
+        else
+            // legacy filter owners not setting a default filter_allocator
+            pic = picture_NewFromFormat( &p_filter->fmt_out.video );
+    }
     if( pic == NULL )
         msg_Warn( p_filter, "can't get output picture" );
     return pic;
-- 
2.17.1



More information about the vlc-devel mailing list