[vlc-devel] [PATCH 1/6] decoder: allow the buffer_new from the decoder to be NULL

Steve Lhomme robux4 at ycbcr.xyz
Tue Jun 25 13:53:12 CEST 2019


Create a picture_t on the fly by default.
---
 src/input/decoder_helpers.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index 1c4593db30..7384e2bda0 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -88,6 +88,8 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
 picture_t *decoder_NewPicture( decoder_t *dec )
 {
     vlc_assert( dec->fmt_in.i_cat == VIDEO_ES && dec->cbs != NULL );
+    if (dec->cbs->video.buffer_new == NULL)
+        return picture_NewFromFormat( &dec->fmt_out.video );
     return dec->cbs->video.buffer_new( dec );
 }
 
-- 
2.17.1



More information about the vlc-devel mailing list