[FFmpeg-devel] [PATCH]lavf/mpegts: Also read three-character language descriptors
Marton Balint
cus at passwd.hu
Mon Apr 3 23:39:54 EEST 2017
On Mon, 3 Apr 2017, Carl Eugen Hoyos wrote:
> Hi!
>
> Attached patch fixes setting the language for the sample from vlc ticket
> #10830: http://streams.videolan.org/issues/10830/vlc-audio-lang.ts
>
> Please comment, Carl Eugen
>
> From d8b30253cc6b1c2156f1e8898e0a0c2ff3c3f900 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos <cehoyos at ag.or.at>
> Date: Mon, 3 Apr 2017 19:03:29 +0200
> Subject: [PATCH] lavf/mpegts: Also read three-character langauge descriptors.
>
> Sets the language for the sample from vlc ticket #10830
> ---
> libavformat/mpegts.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index 3eff152..eff129d 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -1821,11 +1821,12 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
> }
> break;
> case 0x0a: /* ISO 639 language descriptor */
> - for (i = 0; i + 4 <= desc_len; i += 4) {
> + for (i = 0; i + 3 <= desc_len; i += 3) {
I guess you can keep the i += 4 and delete i++ from below.
> language[i + 0] = get8(pp, desc_end);
> language[i + 1] = get8(pp, desc_end);
> language[i + 2] = get8(pp, desc_end);
> language[i + 3] = ',';
> + if (i + 4 <= desc_len) {
> switch (get8(pp, desc_end)) {
> case 0x01:
> st->disposition |= AV_DISPOSITION_CLEAN_EFFECTS;
> @@ -1837,6 +1838,8 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
> st->disposition |= AV_DISPOSITION_VISUAL_IMPAIRED;
> break;
> }
> + i++;
> + }
Make this a patch series and send a second patch which fixes the
indentation.
Thanks,
Marton
More information about the ffmpeg-devel
mailing list