[FFmpeg-devel] [PATCH] lavf/gifdec: add loop support.

Clément Bœsch ubitux at gmail.com
Sat Apr 20 00:21:29 CEST 2013


On Thu, Apr 18, 2013 at 11:50:01PM +0000, Paul B Mahol wrote:
> On 4/18/13, Clement Boesch <ubitux at gmail.com> wrote:
> > ---
> > Still missing FATE update (need to add -ignore_loop to them), but I'm
> > waiting for review on the patch to rework the tests.
> 
> I would prefer that default is to not loop at all.
> 

As you wish, disabled by default. Can be changed later easily if
necessary.

[...]
> > -    if (ret >= 0 && !frame_parsed) {
> > +    if ((ret >= 0 && !frame_parsed) || ret == AVERROR_EOF) {
> >          /* This might happen when there is no image block
> >           * between extension blocks and GIF_TRAILER or EOF */
> > +        if (!gdc->ignore_loop && (block_label == GIF_TRAILER ||
> > url_feof(pb))
> > +            && (gdc->total_iter < 0 || ++gdc->iter_count <
> > gdc->total_iter))
> > +            return avio_seek(pb, 0, SEEK_SET);
> 
> Is it ok too loop on partial file?
> 

I've observed different behaviour; firefox for instance seems to break
will chromium seems to loop. I guess that's a matter of preference.

> >          return AVERROR_EOF;
> >      } else
> >          return ret;
> > @@ -279,6 +300,7 @@ resync:
> >  static const AVOption options[] = {
> >      { "min_delay"    , "minimum valid delay between frames (in hundredths
> > of second)", offsetof(GIFDemuxContext, min_delay)    , AV_OPT_TYPE_INT,
> > {.i64 = GIF_MIN_DELAY}    , 0, 100 * 60, AV_OPT_FLAG_DECODING_PARAM },
> >      { "default_delay", "default delay between frames (in hundredths of
> > second)"      , offsetof(GIFDemuxContext, default_delay), AV_OPT_TYPE_INT,
> > {.i64 = GIF_DEFAULT_DELAY}, 0, 100 * 60, AV_OPT_FLAG_DECODING_PARAM },
> > +    { "ignore_loop"  , "ignore loop setting (netscape extension)"
> >          , offsetof(GIFDemuxContext, ignore_loop)  , AV_OPT_TYPE_INT, {.i64
> > = 0}                , 0,        1, AV_OPT_FLAG_DECODING_PARAM },
> >      { NULL },
> >  };
> >
> > --
> > 1.8.2.1
> 
> rest looks fine

Thanks, queued.

-- 
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/20130420/7ef334b5/attachment.asc>


More information about the ffmpeg-devel mailing list