summaryrefslogtreecommitdiffstats
path: root/gst/apetag/gsttagdemux.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/apetag/gsttagdemux.c')
-rw-r--r--gst/apetag/gsttagdemux.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/apetag/gsttagdemux.c b/gst/apetag/gsttagdemux.c
index 1e52ee2d..1615f3f3 100644
--- a/gst/apetag/gsttagdemux.c
+++ b/gst/apetag/gsttagdemux.c
@@ -458,6 +458,8 @@ gst_tag_demux_chain_parse_tag (GstTagDemux * demux, GstBuffer * collect)
guint tagsize = 0;
guint available;
+ g_assert (gst_buffer_is_metadata_writable (collect));
+
klass = GST_TAG_DEMUX_CLASS (G_OBJECT_GET_CLASS (demux));
/* If we receive a buffer that's from the middle of the file,
@@ -486,6 +488,12 @@ gst_tag_demux_chain_parse_tag (GstTagDemux * demux, GstBuffer * collect)
return;
}
+ /* need to set offset of first buffer to 0 or trimming won't work */
+ if (!GST_BUFFER_OFFSET_IS_VALID (collect)) {
+ GST_WARNING_OBJECT (demux, "Fixing up first buffer without offset");
+ GST_BUFFER_OFFSET (collect) = 0;
+ }
+
GST_DEBUG_OBJECT (demux, "Identified tag, size = %u bytes", tagsize);
do {
@@ -550,6 +558,8 @@ gst_tag_demux_chain (GstPad * pad, GstBuffer * buf)
switch (demux->priv->state) {
case GST_TAG_DEMUX_READ_START_TAG:
+ demux->priv->collect =
+ gst_buffer_make_metadata_writable (demux->priv->collect);
gst_tag_demux_chain_parse_tag (demux, demux->priv->collect);
if (demux->priv->state != GST_TAG_DEMUX_TYPEFINDING)
break;