[FFmpeg-devel] [PATCH 1/2] avformat/dvbtxt: add raw demuxer for dvb teletext probing

Carl Eugen Hoyos cehoyos at ag.or.at
Tue Feb 16 09:41:02 CET 2016


Marton Balint <cus <at> passwd.hu> writes:

> +    /* The purpose of this is demuxer is to detect DVB teletext 
> streams in
> +     * mpegts, so we reject invalid buffer sizes */
> +    if ((p->buf_size + 45) % 184 != 0)
> +        return 0;

I don't think this is ok (although I may miss 
something):
The file could end in the middle of a teletext 
patckage or the end of the probe buffer could 
be within a teletext package.


> +    if (!ff_data_identifier_is_teletext(p->buf[0]))
> +        return 0;
> +
> +    for (buf = p->buf + 1; buf < end; buf += 46) {
> +        if (!ff_data_unit_id_is_teletext(buf[0]) && buf[0] != 0xff)
> +            return 0;
> +        if (buf[1] != 0x2c)     // data_unit_length
> +            return 0;
> +    }

I suspect this should count frames.

> +    return AVPROBE_SCORE_MAX / 2;

Is this ok for one frame?

> +++ b/libavutil/internal.h

Please create a new teletext header in libavcodec.

Thank you!

Carl Eugen



More information about the ffmpeg-devel mailing list