From: Wim Taymans Date: Fri, 4 Dec 2009 13:01:11 +0000 (+0100) Subject: oggdemux: don't do math with invalid granulepos X-Git-Tag: 1.19.3~511^2~8917 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e222a385cd6ac3cc1ac3aca47f131c08e0b34b5;p=platform%2Fupstream%2Fgstreamer.git oggdemux: don't do math with invalid granulepos When the current granulepos is unknown and set to -1, don't try to add durations to it. --- diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index a5b047c..5b1e6f1 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -521,7 +521,8 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet) GST_BUFFER_OFFSET (buf) = 0; GST_BUFFER_OFFSET_END (buf) = -1; } else { - pad->current_granule += duration; + if (pad->current_granule != -1) + pad->current_granule += duration; if (packet->granulepos != -1) { pad->current_granule = gst_ogg_stream_granulepos_to_granule (&pad->map, packet->granulepos);