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

Michael Niedermayer michaelni at gmx.at
Sun May 1 19:33:21 CEST 2011


Hi

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);
+
     return 0;
 }


-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- 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/20110501/b3366207/attachment.asc>


More information about the ffmpeg-devel mailing list