[FFmpeg-devel] [PATCH] ffmpeg2theora ogg_duration.patch

Michael Niedermayer michaelni at gmx.at
Sat May 7 15:30:49 CEST 2011


On Sat, May 07, 2011 at 09:44:26AM +0200, Reimar Döffinger wrote:
> On Sun, May 01, 2011 at 07:33:21PM +0200, Michael Niedermayer wrote:
> > This is one of 2 changes that ffmpeg2theora applies to ffmpeg
> > AUTHORS in ffmpeg2theora says jan gerber <j at v2v.cc> so he is possibly
> > the author of this patch
> > 
> > Index: libavformat/oggdec.c
> > ===================================================================
> > --- libavformat/oggdec.c        (revision 19439)
> > +++ libavformat/oggdec.c        (working copy)
> > @@ -469,6 +469,18 @@
> >      ogg->size = size;
> >      ogg_restore (s, 0);
> > 
> > +    ogg_save (s);
> > +    url_fseek (s->pb, 0, SEEK_SET);
> > +    while (!ogg_read_page (s, &i)){
> > +        if (ogg->streams[i].granule != -1 && ogg->streams[i].granule != 0 &&
> > +            ogg->streams[i].codec) {
> > +            s->streams[i]->duration -=
> > +                ogg_gptopts (s, i, ogg->streams[i].granule, NULL);
> > +            break;
> > +        }
> > +    }
> > +    ogg_restore (s, 0);
> > +
> 
> I think it is ok, it fixes the concern I had with the alternative
> to my patch (might potentially loop over the whole file for some files).
> I wouldn't mind if you mentioned it is based on a patch by me, but
> it's not important (it clearly has been improved).

ok, patch applied locally will push

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110507/c5cee44b/attachment.asc>


More information about the ffmpeg-devel mailing list