[vlc-devel] [PATCH 08/18] decoder: allow empty update_format callbacks in decoder owners
Steve Lhomme
robux4 at ycbcr.xyz
Mon Oct 28 13:41:25 CET 2019
Many of them do trivial things that can be factorized in decoder_helpers.
---
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 ce32608c92c..87ab6bc560f 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 );
}
--
2.17.1
More information about the vlc-devel
mailing list