From f126617dbdf08f6cd91b4b8627f581ea25664472 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sat, 12 Sep 2009 15:48:11 -0700 Subject: [PATCH] oggdemux: Fix duration calculation for truncated files 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index ddb6966..88f4ab7 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -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; } } -- 2.7.4