oggdemux: do not try to determine duration of header packets
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Tue, 23 Aug 2011 09:32:36 +0000 (10:32 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 24 Aug 2011 06:30:45 +0000 (08:30 +0200)
Headers are inherently durationless.
Instead, set duration to 0 to avoid increasing tracked granpos,
and do not warn about it, since it is totally expected.

https://bugzilla.gnome.org/show_bug.cgi?id=657151

ext/ogg/gstoggdemux.c

index e5c0473..1af79a2 100644 (file)
@@ -499,8 +499,13 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
   }
 
   /* get timing info for the packet */
-  duration = gst_ogg_stream_get_packet_duration (&pad->map, packet);
-  GST_DEBUG_OBJECT (ogg, "packet duration %" G_GUINT64_FORMAT, duration);
+  if (gst_ogg_stream_packet_is_header (&pad->map, packet)) {
+    duration = 0;
+    GST_DEBUG_OBJECT (ogg, "packet is header");
+  } else {
+    duration = gst_ogg_stream_get_packet_duration (&pad->map, packet);
+    GST_DEBUG_OBJECT (ogg, "packet duration %" G_GUINT64_FORMAT, duration);
+  }
 
   if (packet->b_o_s) {
     out_timestamp = GST_CLOCK_TIME_NONE;