[FFmpeg-devel] [PATCH v4] Add SUP/PGS subtitle demuxer

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Sep 1 00:12:25 CEST 2014


On Mon, Sep 01, 2014 at 12:05:23AM +0200, wm4 wrote:
> +    for (nb_packets = 0; nb_packets < 10; nb_packets++) {
> +        size_t full_packet_size;
> +        if (buf_size < 10 + 3)
> +            break;
> +        if (memcmp(buf, "PG", 2))
> +            return 0;

AV_RB16(buf) != SUP_PGS_MAGIC
would maybe be more consistent?

> +    if (!nb_packets)
> +        return 0;
> +    if (nb_packets < 2)
> +        return AVPROBE_SCORE_EXTENSION;
> +    if (nb_packets < 4)
> +        return AVPROBE_SCORE_RETRY;
> +    if (nb_packets < 10)
> +        return AVPROBE_SCORE_RETRY + 1;

I think you fell for the same mistake as I.
AVPROBE_SCORE_EXTENSION (50) is in fact much higher than AVPROBE_SCORE_RETRY (25),
so that does not really make sense.


More information about the ffmpeg-devel mailing list