[vlc-commits] core: make the decoder owners use the decoder_Init()

Steve Lhomme git at videolan.org
Mon Feb 18 16:11:19 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 18 14:35:12 2019 +0100| [a0a06f5d70900553cf0d4a07a9ef6866a94fb36f] | committer: Steve Lhomme

core: make the decoder owners use the decoder_Init()

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

 src/input/decoder.c      | 11 ++---------
 src/misc/image.c         |  6 +-----
 test/src/input/decoder.c | 11 ++---------
 3 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 89af5a5d31..0a957317c7 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -169,16 +169,9 @@ static inline struct decoder_owner *dec_get_owner( decoder_t *p_dec )
 static int LoadDecoder( decoder_t *p_dec, bool b_packetizer,
                         const es_format_t *restrict p_fmt )
 {
-    p_dec->b_frame_drop_allowed = true;
-    p_dec->i_extra_picture_buffers = 0;
-
-    p_dec->pf_decode = NULL;
-    p_dec->pf_get_cc = NULL;
-    p_dec->pf_packetize = NULL;
-    p_dec->pf_flush = NULL;
+    decoder_Init( p_dec, p_fmt );
 
-    es_format_Copy( &p_dec->fmt_in, p_fmt );
-    es_format_Init( &p_dec->fmt_out, p_fmt->i_cat, 0 );
+    p_dec->b_frame_drop_allowed = true;
 
     /* Find a suitable decoder/packetizer module */
     if( !b_packetizer )
diff --git a/src/misc/image.c b/src/misc/image.c
index 6c18f84720..7fb0c6baa5 100644
--- a/src/misc/image.c
+++ b/src/misc/image.c
@@ -673,11 +673,7 @@ static decoder_t *CreateDecoder( image_handler_t *p_image, const es_format_t *fm
     p_dec = &p_owner->dec;
     p_owner->p_image = p_image;
 
-    p_dec->p_module = NULL;
-
-    es_format_Copy( &p_dec->fmt_in, fmt );
-    es_format_Init( &p_dec->fmt_out, VIDEO_ES, 0 );
-    p_dec->b_frame_drop_allowed = false;
+    decoder_Init( p_dec, fmt );
 
     static const struct decoder_owner_callbacks dec_cbs =
     {
diff --git a/test/src/input/decoder.c b/test/src/input/decoder.c
index 695aa348c8..7fe2a1bf43 100644
--- a/test/src/input/decoder.c
+++ b/test/src/input/decoder.c
@@ -87,16 +87,9 @@ static void queue_sub(decoder_t *dec, subpicture_t *p_subpic)
 static int decoder_load(decoder_t *decoder, bool is_packetizer,
                          const es_format_t *restrict fmt)
 {
-    decoder->b_frame_drop_allowed = true;
-    decoder->i_extra_picture_buffers = 0;
-
-    decoder->pf_decode = NULL;
-    decoder->pf_get_cc = NULL;
-    decoder->pf_packetize = NULL;
-    decoder->pf_flush = NULL;
+    decoder_Init( decoder, fmt );
 
-    es_format_Copy(&decoder->fmt_in, fmt);
-    es_format_Init(&decoder->fmt_out, fmt->i_cat, 0);
+    decoder->b_frame_drop_allowed = true;
 
     if (!is_packetizer)
     {



More information about the vlc-commits mailing list