[FFmpeg-devel] [PATCH] JACOsub demuxer, decoder and muxer.

Clément Bœsch ubitux at gmail.com
Tue May 1 16:54:42 CEST 2012


On Tue, Apr 17, 2012 at 04:06:45PM +0200, Michael Niedermayer wrote:
> On Sun, Apr 15, 2012 at 07:18:15PM +0200, Clément Bœsch wrote:
> [...]
> 
> > +static int insert_datetime(AVBPrint *dst, const char *in, const char *arg)
> > +{
> > +    char buf[16] = {0};
> > +    time_t now = time(0);
> > +    struct tm ltime;
> > +
> > +#if HAVE_LOCALTIME_R
> > +    localtime_r(&now, &ltime);
> > +#else
> > +    ltime = *localtime(&now);
> > +#endif
> > +    strftime(buf, sizeof(buf), arg, &ltime);
> > +    av_bprintf(dst, "%s", buf);
> > +    return 0;
> > +}
> 
> i wonder what use case this feature has ...
> 

I wonder too, but it's more like an example on how to add various
escape code[1] callbacks. Do you think it should be removed?

> > +static int timed_line(const char *ptr)
> > +{
> > +    char c;
> > +    return (sscanf(ptr, "%*u:%*u:%*u.%*u %*u:%*u:%*u.%*u %c", &c) == 1 ||
> 
> 
> 
> > +            sscanf(ptr, "@%*u @%*u %c",                       &c) == 1);
> 
> this looks a bit weak for AVPROBE_SCORE_MAX, can more be checked ?
> 

Not really; and yes "@NUM @NUM<space>" might not be sufficient. No
numerical padding is forced so I can't use something like "@%08*u" (if
that even works).

I changed the probe return value to AVPROBE_SCORE_MAX/2 (should I divide
even more?). The format is exotic enough to request the user to specify -f
jacosub sometimes I guess.

> 
> also it probably makes sense to try the decoder/demxuer with zzuf

Nothing spotted so far, but I might not be using it at its best.

> but overall the code looks good and IMHO can be pushed, future work
> can be done in git (which is easier than resubmitting patches)
> 

I will push the current version in the following days.

BTW, I fixed the muxing (the general directives are now saved in the
extradata and thus muxed at the end), and a few minor other things.

[1]: http://unicorn.us.com/jacosub/jscripts.html#lines

-- 
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/20120501/4060eb7f/attachment.asc>


More information about the ffmpeg-devel mailing list