summaryrefslogtreecommitdiffstats
path: root/gst/id3demux
diff options
context:
space:
mode:
Diffstat (limited to 'gst/id3demux')
-rw-r--r--gst/id3demux/gstid3demux.c32
-rw-r--r--gst/id3demux/id3tags.c2
2 files changed, 26 insertions, 8 deletions
diff --git a/gst/id3demux/gstid3demux.c b/gst/id3demux/gstid3demux.c
index 10dfcf29..8b37ff86 100644
--- a/gst/id3demux/gstid3demux.c
+++ b/gst/id3demux/gstid3demux.c
@@ -453,7 +453,9 @@ gst_id3demux_chain (GstPad * pad, GstBuffer * buf)
}
/* We failed typefind */
- GST_ELEMENT_ERROR (id3demux, CORE, CAPS, (NULL), ("no caps found"));
+ GST_ELEMENT_ERROR (id3demux, CORE, CAPS,
+ ("Could not determine the mime type of the file"),
+ ("No caps found for contents within an ID3 tag"));
gst_buffer_unref (typefind_buf);
gst_buffer_unref (id3demux->collect);
id3demux->collect = NULL;
@@ -471,6 +473,14 @@ gst_id3demux_chain (GstPad * pad, GstBuffer * buf)
/* Move onto streaming and fall-through to push out existing
* data */
id3demux->state = GST_ID3DEMUX_STREAMING;
+
+ /* Now that typefinding is complete, post the
+ * tags message */
+ if (id3demux->parsed_tags != NULL) {
+ gst_element_post_message (GST_ELEMENT (id3demux),
+ gst_message_new_tag (GST_OBJECT (id3demux),
+ gst_tag_list_copy (id3demux->parsed_tags)));
+ }
/* fall-through */
}
case GST_ID3DEMUX_STREAMING:{
@@ -675,7 +685,9 @@ gst_id3demux_read_id3v1 (GstID3Demux * id3demux, GstTagList ** tags)
tag_res = id3demux_read_id3v1_tag (buffer, &id3demux->strip_end, tags);
if (tag_res == ID3TAGS_READ_TAG) {
- GST_DEBUG_OBJECT (id3demux, "Read ID3v1 tag");
+ GST_DEBUG_OBJECT (id3demux,
+ "Read ID3v1 tag - trimming %d bytes from end of file",
+ id3demux->strip_end);
res = TRUE;
} else if (tag_res == ID3TAGS_BROKEN_TAG) {
GST_WARNING_OBJECT (id3demux, "Ignoring broken ID3v1 tag");
@@ -828,10 +840,19 @@ gst_id3demux_sink_activate (GstPad * sinkpad)
/* 5 - If we didn't find the caps, fail */
if (caps == NULL) {
- GST_DEBUG_OBJECT (id3demux, "Could not detect type of contents");
+ GST_ELEMENT_ERROR (id3demux, CORE, CAPS,
+ ("Could not determine the mime type of the file"),
+ ("No caps found for contents within an ID3 tag"));
goto done_activate;
}
+ /* Now that we've finished typefinding, post tag message on bus */
+ if (id3demux->parsed_tags != NULL) {
+ gst_element_post_message (GST_ELEMENT (id3demux),
+ gst_message_new_tag (GST_OBJECT (id3demux),
+ gst_tag_list_copy (id3demux->parsed_tags)));
+ }
+
/* tag reading and typefinding were already done, don't do them again in
the chain function if we end up in push mode */
id3demux->state = GST_ID3DEMUX_STREAMING;
@@ -1079,11 +1100,6 @@ gst_id3demux_send_tag_event (GstID3Demux * id3demux)
GstTagList *merged = gst_tag_list_merge (id3demux->event_tags,
id3demux->parsed_tags, GST_TAG_MERGE_KEEP);
- if (id3demux->parsed_tags)
- gst_element_post_message (GST_ELEMENT (id3demux),
- gst_message_new_tag (GST_OBJECT (id3demux),
- gst_tag_list_copy (id3demux->parsed_tags)));
-
if (merged) {
GstEvent *event = gst_event_new_tag (merged);
diff --git a/gst/id3demux/id3tags.c b/gst/id3demux/id3tags.c
index 12765e61..a14eccef 100644
--- a/gst/id3demux/id3tags.c
+++ b/gst/id3demux/id3tags.c
@@ -101,6 +101,8 @@ id3demux_read_id3v1_tag (GstBuffer * buffer, guint * id3v1_size,
} else
*tags = new_tags;
+ if (id3v1_size)
+ *id3v1_size = ID3V1_TAG_SIZE;
return ID3TAGS_READ_TAG;
}