oggdemux: fix incorrect testing of invalid granpos values
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 7 Jan 2013 18:01:31 +0000 (18:01 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 7 Jan 2013 18:03:52 +0000 (18:03 +0000)
Positive granulepos is valid, -1 granulepos is unset, and all
other negative granulepos are invalid.

Reported by Tim-Philipp Müller

ext/ogg/gstoggdemux.c

index 731543d..7001f9c 100644 (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) {