[vlc-devel] [PATCH 5/9] core: use the same ES format on input and output of packetizers
Steve Lhomme
robux4 at videolabs.io
Wed Jul 12 16:54:08 CEST 2017
---
src/input/decoder.c | 6 +++++-
src/input/demux.c | 3 ++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 5a976bf111..9e04eb2ada 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -166,7 +166,6 @@ static int LoadDecoder( decoder_t *p_dec, bool b_packetizer,
p_dec->pf_flush = NULL;
es_format_Copy( &p_dec->fmt_in, p_fmt );
- es_format_Init( &p_dec->fmt_out, p_fmt->i_cat, 0 );
/* Find a suitable decoder/packetizer module */
if( !b_packetizer )
@@ -176,15 +175,20 @@ static int LoadDecoder( decoder_t *p_dec, bool b_packetizer,
[AUDIO_ES] = "audio decoder",
[SPU_ES] = "spu decoder",
};
+ es_format_Init( &p_dec->fmt_out, p_fmt->i_cat, 0 );
p_dec->p_module = module_need( p_dec, caps[p_dec->fmt_in.i_cat],
"$codec", false );
}
else
+ {
+ es_format_Copy( &p_dec->fmt_out, p_fmt );
p_dec->p_module = module_need( p_dec, "packetizer", "$packetizer", false );
+ }
if( !p_dec->p_module )
{
es_format_Clean( &p_dec->fmt_in );
+ es_format_Clean( &p_dec->fmt_out );
return -1;
}
if (b_packetizer)
diff --git a/src/input/demux.c b/src/input/demux.c
index f1c6657799..fa001fc822 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -519,12 +519,13 @@ decoder_t *demux_PacketizerNew( demux_t *p_demux, es_format_t *p_fmt, const char
p_packetizer->pf_packetize = NULL;
p_packetizer->fmt_in = *p_fmt;
- es_format_Init( &p_packetizer->fmt_out, p_fmt->i_cat, 0 );
+ es_format_Copy( &p_packetizer->fmt_out, p_fmt );
p_packetizer->p_module = module_need( p_packetizer, "packetizer", NULL, false );
if( !p_packetizer->p_module )
{
es_format_Clean( p_fmt );
+ es_format_Clean( &p_packetizer->fmt_out );
vlc_object_release( p_packetizer );
msg_Err( p_demux, "cannot find packetizer for %s", psz_msg );
return NULL;
--
2.12.1
More information about the vlc-devel
mailing list