diff oggdec.c @ 5637:37e2c3e635b3 libavformat

Fix playback with invalid files that don't set the continuation flag for pages that continue packets started in prior pages. Fixes issue1248
author conrad
date Mon, 08 Feb 2010 10:13:03 +0000
parents 52c7b29eca31
children 829780403fc6
line wrap: on
line diff
--- a/oggdec.c	Sun Feb 07 19:10:04 2010 +0000
+++ b/oggdec.c	Mon Feb 08 10:13:03 2010 +0000
@@ -122,6 +122,7 @@
         os->lastdts = AV_NOPTS_VALUE;
         os->nsegs = 0;
         os->segp = 0;
+        os->incomplete = 0;
     }
 
     ogg->curidx = -1;
@@ -268,7 +269,7 @@
     for (i = 0; i < nsegs; i++)
         size += os->segments[i];
 
-    if (flags & OGG_FLAG_CONT){
+    if (flags & OGG_FLAG_CONT || os->incomplete){
         if (!os->psize){
             while (os->segp < os->nsegs){
                 int seg = os->segments[os->segp++];
@@ -356,6 +357,7 @@
 
         if (!complete && os->segp == os->nsegs){
             ogg->curidx = -1;
+            os->incomplete = 1;
         }
     }while (!complete);
 
@@ -366,6 +368,7 @@
 #endif
 
     ogg->curidx = idx;
+    os->incomplete = 0;
 
     if (os->header < 0){
         int hdr = os->codec->header (s, idx);