[FFmpeg-devel] [PATCH]Fix issue251

Carl Eugen Hoyos cehoyos
Thu Jan 8 20:54:19 CET 2009


Hi!

Attached patch my Michael fixes issue251.

Please comment, Carl Eugem
-------------- next part --------------
Index: libavformat/oggdec.c
===================================================================
--- libavformat/oggdec.c	(revision 16489)
+++ libavformat/oggdec.c	(working copy)
@@ -513,11 +513,25 @@
         return AVERROR(EIO);
     pkt->stream_index = idx;
     memcpy (pkt->data, os->buf + pstart, psize);
+    if (s->streams[idx]->codec->codec_id == CODEC_ID_VORBIS){
     if (os->lastgp != -1LL){
         pkt->pts = ogg_gptopts (s, idx, os->lastgp);
         os->lastgp = -1;
     }
+    }else{
+        int segp= os->segp;
+        int nsegs=os->nsegs;
+        while (segp < nsegs){
+            if (os->segments[segp] < 255)
+                break;
+            segp++;
+        }
 
+        if (segp == nsegs && os->granule != -1LL){
+            pkt->pts = ogg_gptopts (s, idx, os->granule);
+        }
+    }
+
     pkt->flags = os->pflags;
 
     return psize;



More information about the ffmpeg-devel mailing list