ext/ogg/gstoggmux.c: Make sure we never send -1 granulepos.
authorWim Taymans <wim.taymans@gmail.com>
Sun, 22 Aug 2004 09:31:06 +0000 (09:31 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Sun, 22 Aug 2004 09:31:06 +0000 (09:31 +0000)
Original commit message from CVS:
* ext/ogg/gstoggmux.c: (gst_ogg_mux_next_buffer),
(gst_ogg_mux_send_headers), (gst_ogg_mux_loop):
Make sure we never send -1 granulepos.

ChangeLog
ext/ogg/gstoggmux.c

index e8524f0..b80d310 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-08-22  Wim Taymans  <wim@fluendo.com>
+
+       * ext/ogg/gstoggmux.c: (gst_ogg_mux_next_buffer),
+       (gst_ogg_mux_send_headers), (gst_ogg_mux_loop):
+       Make sure we never send -1 granulepos.
+
 2004-08-20  Wim Taymans  <wim@fluendo.com>
 
        * ext/ogg/gstoggmux.c: (gst_ogg_mux_next_buffer),
index 15e7e72..7e0d51a 100644 (file)
@@ -714,6 +714,8 @@ gst_ogg_mux_send_headers (GstOggMux * mux)
     packet.packet = GST_BUFFER_DATA (buf);
     packet.bytes = GST_BUFFER_SIZE (buf);
     packet.granulepos = GST_BUFFER_OFFSET_END (buf);
+    if (packet.granulepos == -1)
+      packet.granulepos = 0;
     /* mark BOS and packet number */
     packet.b_o_s = (pad->packetno == 0);
     packet.packetno = pad->packetno++;
@@ -755,6 +757,8 @@ gst_ogg_mux_send_headers (GstOggMux * mux)
       packet.packet = GST_BUFFER_DATA (buf);
       packet.bytes = GST_BUFFER_SIZE (buf);
       packet.granulepos = GST_BUFFER_OFFSET_END (buf);
+      if (packet.granulepos == -1)
+        packet.granulepos = 0;
       /* mark BOS and packet number */
       packet.b_o_s = (pad->packetno == 0);
       packet.packetno = pad->packetno++;
@@ -910,6 +914,8 @@ gst_ogg_mux_loop (GstElement * element)
     packet.packet = GST_BUFFER_DATA (buf);
     packet.bytes = GST_BUFFER_SIZE (buf);
     packet.granulepos = GST_BUFFER_OFFSET_END (buf);
+    if (packet.granulepos == -1)
+      packet.granulepos = 0;
     /* mark BOS and packet number */
     packet.b_o_s = (pad->packetno == 0);
     packet.packetno = pad->packetno++;