diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-12-04 14:01:11 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-12-04 14:01:11 +0100 |
commit | 9e222a385cd6ac3cc1ac3aca47f131c08e0b34b5 (patch) | |
tree | 7a2b1c838ca55e9a0f9d14f548c3bba190c743e1 | |
parent | 96e1c4dbe6f524a448ebde33b2cbdd91e50e18f2 (diff) |
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.
-rw-r--r-- | ext/ogg/gstoggdemux.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index a5b047cc2..5b1e6f15d 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); |