[vlc-devel] [PATCH 06/14] filter: allow the owner not to provide a buffer callback

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


In this case we just allocate a picture from the filter output format.
---
 include/vlc_filter.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index 95b9db1ce0..dc1af0b8f7 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -26,6 +26,7 @@
 #define VLC_FILTER_H 1
 
 #include <vlc_es.h>
+#include <vlc_picture.h>
 
 /**
  * \defgroup filter Filters
@@ -172,7 +173,11 @@ struct filter_t
  */
 static inline picture_t *filter_NewPicture( filter_t *p_filter )
 {
-    picture_t *pic = p_filter->video_owner.video->buffer_new( p_filter );
+    picture_t *pic;
+    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
+        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