oggdemux: fix incorrect testing of invalid granpos values

Positive granulepos is valid, -1 granulepos is unset, and all
other negative granulepos are invalid.

Reported by Tim-Philipp Müller
This commit is contained in:
Vincent Penquerc'h 2013-01-07 18:01:31 +00:00
parent 7107e97273
commit 658195e6de

View file

@ -878,7 +878,7 @@ gst_ogg_pad_submit_packet (GstOggPad * pad, ogg_packet * packet)
granule = gst_ogg_stream_granulepos_to_granule (&pad->map,
packet->granulepos);
if (granule != -1) {
if (granule >= 0) {
GST_DEBUG_OBJECT (ogg, "%p has granulepos %" G_GINT64_FORMAT, pad, granule);
pad->current_granule = granule;
} else if (granule != -1) {