summaryrefslogtreecommitdiff
path: root/gst/modplug
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sourceforge.net>2008-11-04 20:26:00 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2008-11-04 20:26:00 +0000
commita5bf402c557ad3b908b253e87a7f6c4b437b5a0c (patch)
tree3a5815d2546d9463e7c29f80a2833ef873b85bc9 /gst/modplug
parente6587d7dcc0189d94452ab722e67cdde179fd58f (diff)
downloadgstreamer-plugins-bad-a5bf402c557ad3b908b253e87a7f6c4b437b5a0c.tar.gz
gst/modplug/gstmodplug.cc: Send tag event. Fixes #559286.
Original commit message from CVS: * gst/modplug/gstmodplug.cc: Send tag event. Fixes #559286.
Diffstat (limited to 'gst/modplug')
-rw-r--r--gst/modplug/gstmodplug.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc
index 6f6e1869d..d1c91d8d5 100644
--- a/gst/modplug/gstmodplug.cc
+++ b/gst/modplug/gstmodplug.cc
@@ -609,7 +609,9 @@ gst_modplug_loop (GstModPlug * modplug)
/* actually load it */
if (modplug->offset == modplug->song_size) {
GstEvent *newsegment;
+ GstTagList *tags;
gboolean ok;
+ gchar comment[16384];
ok = gst_modplug_load_song (modplug);
gst_buffer_unref (modplug->buffer);
@@ -623,6 +625,21 @@ gst_modplug_loop (GstModPlug * modplug)
newsegment = gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME,
0, modplug->song_length, 0);
gst_pad_push_event (modplug->srcpad, newsegment);
+
+ /* get and send metadata */
+ tags = gst_tag_list_new ();
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
+ GST_TAG_TITLE, modplug->mSoundFile->GetTitle (),
+ GST_TAG_BEATS_PER_MINUTE,
+ (gdouble) modplug->mSoundFile->GetMusicTempo (), NULL);
+
+ if (modplug->mSoundFile->GetSongComments ((gchar *) & comment, 16384, 32)) {
+ gst_tag_list_add (tags, GST_TAG_MERGE_APPEND,
+ GST_TAG_COMMENT, comment, NULL);
+ }
+
+
+ gst_element_found_tags (GST_ELEMENT (modplug), tags);
} else {
/* not fully loaded yet */
return;