[FFmpeg-devel] [PATCH 1/4] add SRT parser, demuxer and muxer

Michael Niedermayer michaelni
Wed Jul 7 22:44:13 CEST 2010


On Wed, Jul 07, 2010 at 12:14:58PM +0200, Aurelien Jacobs wrote:
> On Wed, Jul 07, 2010 at 12:45:34AM -0700, Alexander Strange wrote:
> > 
> > On Jul 6, 2010, at 1:54 PM, Aurelien Jacobs wrote:
> > 
> > > 
> > > ---
> > > libavcodec/Makefile      |    1 +
> > > libavcodec/allcodecs.c   |    1 +
> > > libavcodec/avcodec.h     |    1 +
> > > libavcodec/srt_parser.c  |   82 ++++++++++++++++++++++++++++++++++++++++++++++
> > > libavformat/Makefile     |    2 +
> > > libavformat/allformats.c |    1 +
> > > libavformat/raw.c        |   12 +++++++
> > > libavformat/srtdec.c     |   68 ++++++++++++++++++++++++++++++++++++++
> > > 8 files changed, 168 insertions(+), 0 deletions(-)
> > > create mode 100644 libavcodec/srt_parser.c
> > > create mode 100644 libavformat/srtdec.c
> > > <add-srt-parser-demuxer-and-mux.patch>
> > 
> > 
> > > +        if (sscanf(buf, "%d:%2d:%2d,%3d --> %*d:%*2d:%*2d,%3d",
> > > +                   &hour, &min, &sec, &hsec, &v) == 5) {
> > > +            min += 60*hour;
> > > +            sec += 60*min;
> > > +            return sec*1000+hsec;
> > > +        }
> > 
> > srt can have , or . decimal separators.
> 
> While there is no official spec for srt, I've found quite a few
> description of it in the wild. All of them specify that , is the decimal
> separator.
> I've also grabed a whole bunch of samples, and all of them are using ,.
> The only reference that I could find for . as a decimal separator is a
> test file on http://ale5000.altervista.org/subtitles.htm
> So, IMHO, usage of . is not legitimate. But as other players are
> supporting it, I've just improved my patch to support it too.
> 
> Aurel
>  libavcodec/Makefile      |    1 
>  libavcodec/allcodecs.c   |    1 
>  libavcodec/avcodec.h     |    1 
>  libavcodec/srt_parser.c  |   82 +++++++++++++++++++++++++++++++++++++++++++++++
>  libavformat/Makefile     |    2 +
>  libavformat/allformats.c |    1 
>  libavformat/raw.c        |   12 ++++++
>  libavformat/srtdec.c     |   67 ++++++++++++++++++++++++++++++++++++++
>  8 files changed, 167 insertions(+)
> 272dce59f14f1662d365e058ca3c7bf97d87d75f  add-srt-parser-demuxer-and-mux.diff
> add SRT parser, demuxer and muxer

looks good to me
assuming it works, is tested, passes tests with a fuzzer, and noone
has further comments

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I wish the Xiph folks would stop pretending they've got something they
do not.  Somehow I fear this will remain a wish. -- M?ns Rullg?rd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100707/d2bd33fc/attachment.pgp>



More information about the ffmpeg-devel mailing list