[vlc-commits] STL: merge GSI parsing
Stefan Pöschel
git at videolan.org
Fri Nov 10 09:24:57 CET 2017
vlc | branch: master | Stefan Pöschel <github at basicmaster.de> | Wed Nov 8 21:55:35 2017 +0100| [f0f500291db1bb5ba0bac9761c73c683498a04f4] | committer: Jean-Baptiste Kempf
STL: merge GSI parsing
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f0f500291db1bb5ba0bac9761c73c683498a04f4
---
modules/codec/stl.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/modules/codec/stl.c b/modules/codec/stl.c
index 4c73c1c067..2ee88bab2e 100644
--- a/modules/codec/stl.c
+++ b/modules/codec/stl.c
@@ -432,7 +432,7 @@ static int Decode(decoder_t *p_dec, block_t *p_block)
return VLCDEC_SUCCESS;
}
-static int ExtractCCT(const decoder_t *dec, cct_number_value_t *cct_number)
+static int ParseGSI(const decoder_t *dec, decoder_sys_t *p_sys)
{
uint8_t *header = dec->fmt_in.p_extra;
if (!header) {
@@ -450,8 +450,8 @@ static int ExtractCCT(const decoder_t *dec, cct_number_value_t *cct_number)
msg_Err(dec, "EBU header contains illegal CCT (0x%x)\n", cct);
return VLC_EGENERIC;
}
-
- *cct_number = cct;
+ msg_Dbg(dec, "CCT=0x%x", cct);
+ p_sys->cct = cct;
return VLC_SUCCESS;
}
@@ -463,18 +463,14 @@ static int Open(vlc_object_t *object)
if (dec->fmt_in.i_codec != VLC_CODEC_EBU_STL)
return VLC_EGENERIC;
- cct_number_value_t cct;
- int rc = ExtractCCT(dec, &cct);
- if (VLC_SUCCESS != rc)
- return rc;
-
- msg_Dbg(dec, "CCT=0x%x", cct);
-
decoder_sys_t *sys = calloc(1, sizeof(*sys));
if (!sys)
return VLC_ENOMEM;
- sys->cct = cct;
+ int rc = ParseGSI(dec, sys);
+ if (VLC_SUCCESS != rc)
+ return rc;
+
for(size_t i=0; i<=STL_GROUPS_MAX; i++)
sys->groups[i].pp_segment_last = &sys->groups[i].p_segment;
More information about the vlc-commits
mailing list