ext/mad/gstid3tag.c: rewrite buffer offset
authorBenjamin Otte <otte@gnome.org>
Thu, 29 Apr 2004 00:13:16 +0000 (00:13 +0000)
committerBenjamin Otte <otte@gnome.org>
Thu, 29 Apr 2004 00:13:16 +0000 (00:13 +0000)
Original commit message from CVS:
* ext/mad/gstid3tag.c: (gst_id3_tag_handle_event),
(gst_id3_tag_chain):
rewrite buffer offset

ChangeLog
ext/mad/gstid3tag.c

index 15fac99910559f8c36e9b18442a224ada1af525e..7fc40e837c0949f34171230cbdc3f20d275143c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-04-29  Benjamin Otte  <otte@gnome.org>
+
+       * ext/mad/gstid3tag.c: (gst_id3_tag_handle_event),
+       (gst_id3_tag_chain):
+         rewrite buffer offset
+
 2004-04-28  Ronald Bultje  <rbultje@ronald.bitfreak.net>
 
        * configure.ac:
index 8b02ec5e745c388f9906b12965bf1a0bf9e5c9a4..ade3006cefedf9a589dfca409967160ac9598b8f 100644 (file)
@@ -760,7 +760,10 @@ gst_id3_tag_handle_event (GstPad * pad, GstEvent * event)
                     GST_BUFFER_SIZE (tag->buffer)
                     : 0))
               GST_ELEMENT_ERROR (tag, CORE, EVENT, (NULL),
-                  ("Seek during ID3v2 tag reading"));
+                  ("Got seek to %" G_GUINT64_FORMAT " during ID3v2 tag reading"
+                      " (allowed was %" G_GUINT64_FORMAT ")", value,
+                      (guint64) (tag->buffer ? GST_BUFFER_OFFSET (tag->buffer)
+                          + GST_BUFFER_SIZE (tag->buffer) : 0)));
           }
           gst_data_unref (GST_DATA (event));
           break;
@@ -1162,6 +1165,16 @@ gst_id3_tag_chain (GstPad * pad, GstData * data)
           gst_data_unref (GST_DATA (buffer));
           buffer = sub;
         }
+        if (tag->v2tag_size) {
+          GstBuffer *sub =
+              gst_buffer_create_sub (buffer, 0, GST_BUFFER_SIZE (buffer));
+          GST_BUFFER_OFFSET (sub) =
+              GST_BUFFER_OFFSET (buffer) - tag->v2tag_size;
+          GST_BUFFER_OFFSET_END (sub) =
+              GST_BUFFER_OFFSET_END (buffer) - tag->v2tag_size;
+          gst_data_unref (GST_DATA (buffer));
+          buffer = sub;
+        }
         gst_pad_push (tag->srcpad, GST_DATA (buffer));
       }
       return;