[FFmpeg-devel] [PATCH 2/4] avcodec/dvdsubdec: extract every subtitle in a different file (debug).

Clément Bœsch u at pkh.me
Sun Sep 29 23:43:17 CEST 2013


On Sun, Sep 29, 2013 at 02:38:19PM -0700, Timothy Gu wrote:
[...]
> >  #if defined(DEBUG)
> > +    {
> > +    char ppm_name[32];
> > +
> > +    snprintf(ppm_name, sizeof ppm_name, "/tmp/%05d.ppm", ctx->sub_id++);
> 
> I'm a terrible C programmer and I might miss something, but shouldn't it be
> sizeof(ppm_name)?
> 

No, that code is valid C; sizeof is a built-in and it works. But sorry,
it's a bad habit and inconsistent with the rest of the code base, consider
it changed locally.

> >      av_dlog(NULL, "start=%d ms end =%d ms\n",
> >              sub->start_display_time,
> >              sub->end_display_time);
> > -    ppm_save("/tmp/a.ppm", sub->rects[0]->pict.data[0],
> > +    ppm_save(ppm_name, sub->rects[0]->pict.data[0],
> >               sub->rects[0]->w, sub->rects[0]->h,
> sub->rects[0]->pict.data[1]);

Note: you should fix your mail, it often mangles your reviews and it's
sometimes hard to find what is a comment, and what is due to the broken
wrapping of your mailer.

[...]

-- 
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/20130929/24483e86/attachment.asc>


More information about the ffmpeg-devel mailing list