[FFmpeg-devel] [PATCH] lavf/srtdec: recognize subtitles starting at event index 0.

Clément Bœsch ubitux at gmail.com
Mon Nov 5 07:33:30 CET 2012


On Sun, Nov 04, 2012 at 03:15:15PM -0800, Philip Langdale wrote:
> On Sun,  4 Nov 2012 23:22:57 +0100
> Clément Bœsch <ubitux at gmail.com> wrote:
> 
> > ---
> >  libavformat/srtdec.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
> > index 4f5f095..9089331 100644
> > --- a/libavformat/srtdec.c
> > +++ b/libavformat/srtdec.c
> > @@ -32,7 +32,8 @@ static int srt_probe(AVProbeData *p)
> >          ptr += 3;  /* skip UTF-8 BOM */
> >  
> >      for (i=0; i<2; i++) {
> > -        if (num == i && sscanf(ptr, "%*d:%*2d:%*2d%*1[,.]%*3d -->
> > %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
> > +        if ((num == i || num + 1 == i)
> > +            && sscanf(ptr, "%*d:%*2d:%*2d%*1[,.]%*3d -->
> > %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1) return AVPROBE_SCORE_MAX;
> >          num = atoi(ptr);
> >          ptr += strcspn(ptr, "\n") + 1;
> 
> LGTM
> 

Applied, thanks.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121105/e8824164/attachment.asc>


More information about the ffmpeg-devel mailing list