[FFmpeg-cvslog] r22478 - in trunk/libavformat: oggdec.c oggdec.h

conrad subversion
Fri Mar 12 06:17:01 CET 2010


Author: conrad
Date: Fri Mar 12 06:17:01 2010
New Revision: 22478

Log:
oggdec: Pass packets to header() until the stream is done with them

This fixes some old ogm files that had the 3rd vorbis header after a data
packet in another stream. This is invalid in ogg, but this change shouldn't
affect the behaviour of any valid file.

Modified:
   trunk/libavformat/oggdec.c
   trunk/libavformat/oggdec.h

Modified: trunk/libavformat/oggdec.c
==============================================================================
--- trunk/libavformat/oggdec.c	Fri Mar 12 06:16:57 2010	(r22477)
+++ trunk/libavformat/oggdec.c	Fri Mar 12 06:17:01 2010	(r22478)
@@ -364,21 +364,19 @@ ogg_packet (AVFormatContext * s, int *st
     ogg->curidx = idx;
     os->incomplete = 0;
 
-    if (!ogg->headers){
-        int hdr = os->codec->header (s, idx);
-        os->header = os->seq;
-        if (!hdr){
+    if (os->header) {
+        os->header = os->codec->header (s, idx);
+        if (!os->header){
             os->segp = segp;
             os->psize = psize;
+            if (!ogg->headers)
+                s->data_offset = os->sync_pos;
             ogg->headers = 1;
-            s->data_offset = os->sync_pos;
         }else{
             os->pstart += os->psize;
             os->psize = 0;
         }
-    }
-
-    if (os->header > -1 && os->seq > os->header){
+    } else {
         os->pflags = 0;
         os->pduration = 0;
         if (os->codec && os->codec->packet)
@@ -405,7 +403,6 @@ ogg_packet (AVFormatContext * s, int *st
             break;
         }
 
-    os->seq++;
     if (os->segp == os->nsegs)
         ogg->curidx = -1;
 

Modified: trunk/libavformat/oggdec.h
==============================================================================
--- trunk/libavformat/oggdec.h	Fri Mar 12 06:16:57 2010	(r22477)
+++ trunk/libavformat/oggdec.h	Fri Mar 12 06:17:01 2010	(r22478)
@@ -62,7 +62,6 @@ struct ogg_stream {
     unsigned int pflags;
     unsigned int pduration;
     uint32_t serial;
-    uint32_t seq;
     uint64_t granule;
     int64_t lastpts;
     int64_t lastdts;



More information about the ffmpeg-cvslog mailing list