[FFmpeg-devel] [PATCH v2 5/6] avformat/srtdec: speed up probing
Clément Bœsch
u at pkh.me
Fri Sep 5 23:23:38 CEST 2014
On Thu, Sep 04, 2014 at 10:40:26PM +0200, wm4 wrote:
> ---
> As suggested by ubitux. Note that the change to ff_subtitles_read_line()
> already cuts down the probing time a lot, so maybe this is not needed.
> ---
> libavformat/srtdec.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
> index b63d344..f5f3933 100644
> --- a/libavformat/srtdec.c
> +++ b/libavformat/srtdec.c
> @@ -43,6 +43,7 @@ static int srt_probe(AVProbeData *p)
> if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0)
> break;
> if ((num == i || num + 1 == i)
> + && buf[0] >= '0' && buf[1] <= '9' && strstr(buf, " --> ")
> && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
> return AVPROBE_SCORE_MAX;
> num = atoi(buf);
Pushed.
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140905/6dd4913c/attachment.asc>
More information about the ffmpeg-devel
mailing list