From fea50233bb0d2ba54b142e735fa300e2191f3dbd Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 12 Oct 2010 16:03:36 +0200 Subject: [PATCH] oggdemux: only keep last valid granulepos Only keep the last valid granulepos we see when scanning the last pages. It is possible that the last page that we inspect has a -1 granulepos, in which case we want to keep the previous valid time instead. Fixes #631703 --- ext/ogg/gstoggdemux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index c4e64c85f7..bb20a81509 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -2827,9 +2827,9 @@ gst_ogg_demux_read_end_chain (GstOggDemux * ogg, GstOggChain * chain) if (pad->map.serialno == ogg_page_serialno (&og)) { gint64 granulepos = ogg_page_granulepos (&og); - last_granule = granulepos; - last_pad = pad; - if (last_granule != -1) { + if (granulepos != -1) { + last_granule = granulepos; + last_pad = pad; done = TRUE; } break;