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

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 18 14:36:17 2019 +0100| [257116003491a6c88804233506cfe38207a6b04c] | committer: Steve Lhomme

modules: make the decoder owners use the decoder_Init()

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

 modules/stream_out/mosaic_bridge.c       | 4 ++--
 modules/stream_out/sdi/SDIStream.cpp     | 8 +-------
 modules/stream_out/transcode/transcode.c | 6 ++----
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index 4054b65202..bd2bd13e5d 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -291,8 +291,8 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
     if( !p_owner )
         return NULL;
     p_sys->p_decoder = &p_owner->dec;
-    p_sys->p_decoder->p_module = NULL;
-    p_sys->p_decoder->fmt_in = *p_fmt;
+    decoder_Init( p_sys->p_decoder, p_fmt );
+
     p_sys->p_decoder->b_frame_drop_allowed = true;
     p_sys->p_decoder->fmt_out = p_sys->p_decoder->fmt_in;
     p_sys->p_decoder->fmt_out.i_extra = 0;
diff --git a/modules/stream_out/sdi/SDIStream.cpp b/modules/stream_out/sdi/SDIStream.cpp
index a07b35504a..9e657f4aa1 100644
--- a/modules/stream_out/sdi/SDIStream.cpp
+++ b/modules/stream_out/sdi/SDIStream.cpp
@@ -217,16 +217,10 @@ bool AbstractDecodedStream::init(const es_format_t *p_fmt)
     p_owner->id = this;
 
     p_decoder = &p_owner->dec;
-    p_decoder->p_module = NULL;
-    es_format_Init(&p_decoder->fmt_out, p_fmt->i_cat, 0);
-    es_format_Copy(&p_decoder->fmt_in, p_fmt);
-    p_decoder->b_frame_drop_allowed = false;
+    decoder_Init( p_decoder, p_fmt );
 
     setCallbacks();
 
-    p_decoder->pf_decode = NULL;
-    p_decoder->pf_get_cc = NULL;
-
     p_decoder->p_module = module_need_var(p_decoder, category, "codec");
     if(!p_decoder->p_module)
     {
diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index 782b100e6b..feee667993 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -600,11 +600,9 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
     p_owner->p_obj = VLC_OBJECT(p_stream);
 
     id->p_decoder = &p_owner->dec;
-    id->p_decoder->p_module = NULL;
-    es_format_Init( &id->p_decoder->fmt_out, p_fmt->i_cat, 0 );
-    es_format_Copy( &id->p_decoder->fmt_in, p_fmt );
+    decoder_Init( id->p_decoder, p_fmt );
+
     es_format_SetMeta( &id->p_decoder->fmt_out, &id->p_decoder->fmt_in );
-    id->p_decoder->b_frame_drop_allowed = false;
 
     switch( p_fmt->i_cat )
     {



More information about the vlc-commits mailing list