Re: [FFmpeg-devel] [PATCH] avformat/srtdec: give WebVTT priority

2015-10-09 Thread Clément Bœsch
On Thu, Oct 08, 2015 at 11:51:32PM +0200, wm4 wrote:
> On Thu,  8 Oct 2015 19:40:38 +0200
> wm4  wrote:
> 
> > WevVTT and SRT can look very similar. For some samples, they both
> > succeed and return AVPROBE_SCORE_MAX, which leads to probing failure.
> > 
> > This gives priority to WebVTT in ambiguous cases. Since WebVTT only
> > succeeds if the header is present, it's pretty sure WebVTT should win in
> > these cases.
> > ---
> >  libavformat/srtdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
> > index e9cd647..6067122 100644
> > --- a/libavformat/srtdec.c
> > +++ b/libavformat/srtdec.c
> > @@ -53,7 +53,7 @@ static int srt_probe(AVProbeData *p)
> >  return 0;
> >  if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ")
> >  && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> 
> > %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
> > -return AVPROBE_SCORE_MAX;
> > +return AVPROBE_SCORE_MAX - 1;
> >  
> >  return 0;
> >  }
> 
> Patch withdrawn. This is actually a regression due to bad strtol()
> usage, and will be fixed by ubitux later.

Fixed & backported, sry & thx


-- 
Clément B.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/srtdec: give WebVTT priority

2015-10-08 Thread wm4
On Thu,  8 Oct 2015 19:40:38 +0200
wm4  wrote:

> WevVTT and SRT can look very similar. For some samples, they both
> succeed and return AVPROBE_SCORE_MAX, which leads to probing failure.
> 
> This gives priority to WebVTT in ambiguous cases. Since WebVTT only
> succeeds if the header is present, it's pretty sure WebVTT should win in
> these cases.
> ---
>  libavformat/srtdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
> index e9cd647..6067122 100644
> --- a/libavformat/srtdec.c
> +++ b/libavformat/srtdec.c
> @@ -53,7 +53,7 @@ static int srt_probe(AVProbeData *p)
>  return 0;
>  if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ")
>  && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> 
> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
> -return AVPROBE_SCORE_MAX;
> +return AVPROBE_SCORE_MAX - 1;
>  
>  return 0;
>  }

Patch withdrawn. This is actually a regression due to bad strtol()
usage, and will be fixed by ubitux later.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/srtdec: give WebVTT priority

2015-10-08 Thread Clément Bœsch
On Thu, Oct 08, 2015 at 07:40:38PM +0200, wm4 wrote:
> WevVTT and SRT can look very similar. For some samples, they both
> succeed and return AVPROBE_SCORE_MAX, which leads to probing failure.
> 

oO

Can I see a sample that this commit fixes?

> This gives priority to WebVTT in ambiguous cases. Since WebVTT only
> succeeds if the header is present, it's pretty sure WebVTT should win in
> these cases.
> ---
>  libavformat/srtdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
> index e9cd647..6067122 100644
> --- a/libavformat/srtdec.c
> +++ b/libavformat/srtdec.c
> @@ -53,7 +53,7 @@ static int srt_probe(AVProbeData *p)
>  return 0;
>  if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ")
>  && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> 
> %*d:%*2d:%*2d%*1[,.]%3d", &v) == 1)
> -return AVPROBE_SCORE_MAX;
> +return AVPROBE_SCORE_MAX - 1;
>  
>  return 0;
>  }

-- 
Clément B.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/srtdec: give WebVTT priority

2015-10-08 Thread wm4
WevVTT and SRT can look very similar. For some samples, they both
succeed and return AVPROBE_SCORE_MAX, which leads to probing failure.

This gives priority to WebVTT in ambiguous cases. Since WebVTT only
succeeds if the header is present, it's pretty sure WebVTT should win in
these cases.
---
 libavformat/srtdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index e9cd647..6067122 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -53,7 +53,7 @@ static int srt_probe(AVProbeData *p)
 return 0;
 if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ")
 && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> %*d:%*2d:%*2d%*1[,.]%3d", 
&v) == 1)
-return AVPROBE_SCORE_MAX;
+return AVPROBE_SCORE_MAX - 1;
 
 return 0;
 }
-- 
2.5.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel