oggdemux: Fix duration calculation for truncated files
authorDavid Schleef <ds@schleef.org>
Sat, 12 Sep 2009 22:48:11 +0000 (15:48 -0700)
committerDavid Schleef <ds@schleef.org>
Sun, 13 Sep 2009 17:58:12 +0000 (10:58 -0700)
If the last page of a stream has a granulepos of -1, that is,
it doesn't complete a packet, we need to continue to search
for the last granulepos.

ext/ogg/gstoggdemux.c

index ddb6966..88f4ab7 100644 (file)
@@ -2617,7 +2617,9 @@ gst_ogg_demux_read_end_chain (GstOggDemux * ogg, GstOggChain * chain)
             last_granule = granulepos;
             last_pad = pad;
           }
-          done = TRUE;
+          if (last_granule != -1) {
+            done = TRUE;
+          }
           break;
         }
       }