[vlc-commits] decoder: allow empty update_format callbacks in decoder owners

Steve Lhomme git at videolan.org
Mon Nov 4 10:41:55 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Oct 28 11:14:16 2019 +0100| [f052b6f7e3daf494fef8c1fa9a11d89634ad9a9b] | committer: Steve Lhomme

decoder: allow empty update_format callbacks in decoder owners

Many of them do trivial things that can be factorized in decoder_helpers.

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

 src/input/decoder_helpers.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index ce32608c92..87ab6bc560 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -84,13 +84,15 @@ int decoder_UpdateVideoFormat( decoder_t *dec )
 int decoder_UpdateVideoOutput( decoder_t *dec, vlc_video_context *vctx_out )
 {
     vlc_assert( dec->fmt_in.i_cat == VIDEO_ES && dec->cbs != NULL );
-    if ( unlikely(dec->fmt_in.i_cat != VIDEO_ES || dec->cbs == NULL ||
-                  dec->cbs->video.format_update == NULL) )
+    if ( unlikely(dec->fmt_in.i_cat != VIDEO_ES || dec->cbs == NULL) )
         return -1;
 
     /* */
     dec->fmt_out.video.i_chroma = dec->fmt_out.i_codec;
 
+    if (dec->cbs->video.format_update == NULL)
+        return 0;
+
     return dec->cbs->video.format_update( dec, vctx_out );
 }
 



More information about the vlc-commits mailing list