[FFmpeg-devel] [PATCH v5] Add SUP/PGS subtitle demuxer
Carl Eugen Hoyos
cehoyos at ag.or.at
Mon Sep 1 10:34:52 CEST 2014
wm4 <nfxjfg <at> googlemail.com> writes:
> + avio_rb32(s->pb); /* discard DTS (usually 0, and useless) */
Would it be an option to set it dts to AV_NOPTS_VALUE
if this value is 0 but use the value otherwise?
Or is there no advantage?
> + full_packet_size = AV_RB16(buf + 10 + 1) + 10 + 3;
> + if (buf_size < full_packet_size)
> + break;
I don't know if it is worth the effort, but you could
check for the first byte as well:
if (buf != 0x80 || (buf | 3) != 17)
With this change, you could increase the scores, reduce
the number of maximum packets in the loop and maybe
speed up probing iiuc.
> + if (nb_packets < 4)
> + return AVPROBE_SCORE_RETRY;
If you find three consecutive packets on the
start of the file, at least EXTENSION is
appropriate imo even without checking the
content, possibly more.
More information about the ffmpeg-devel