[FFmpeg-devel] [PATCH 2/2 v2] lavf/mpegts: add reading of ARIB data coding descriptor

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Feb 3 15:12:23 EET 2019


2019-02-03 1:39 GMT+01:00, Jan Ekström <jeebjp at gmail.com>:
> This enables us to read the data coding type utilized for
> a specific private data stream, of which we currently are
> interested in ARIB caption streams.
>
> The component tag limitations are according to ARIB TR-B14,
> and the component IDs are defined in ARIB STD-B10.
> ---
>  libavformat/mpegts.c  | 44 +++++++++++++++++++++++++++++++++++++++++++
>  libavformat/version.h |  2 +-
>  2 files changed, 45 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index 300db110d4..f9dc04eb52 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -2013,6 +2013,50 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc,
> AVStream *st, int stream_type
>              }
>          }
>          break;
> +    case 0xfd: /* ARIB data coding type descriptor */
> +        // STD-B24, fascicle 3, chapter 4 defines private_stream_1
> +        // for captions
> +        if (stream_type == STREAM_TYPE_PRIVATE_DATA) {
> +            // This structure is defined in STD-B10, part 1, listing 5.4
> and
> +            // part 2, 6.2.20).
> +            // Listing of data_component_ids is in STD-B10, part 2, Annex
> J.
> +            // Component tag limits are documented in TR-B14, fascicle 2,
> +            // Vol. 3, Section 2, 4.2.8.1
> +            int actual_component_tag = st->stream_identifier - 1;
> +            int picked_profile = FF_PROFILE_UNKNOWN;
> +            int data_component_id = get16(pp, desc_end);

> +            if (data_component_id < 0)
> +                return AVERROR_INVALIDDATA;

What is the effect of this return if it happens?
Why isn't this just a "break" like below?

Carl Eugen


More information about the ffmpeg-devel mailing list