gst/modplug/gstmodplug.cc: Send tag event. Fixes #559286.

Original commit message from CVS:
* gst/modplug/gstmodplug.cc:
Send tag event. Fixes #559286.
This commit is contained in:
Stefan Kost 2008-11-04 20:26:00 +00:00
parent e6587d7dcc
commit a5bf402c55
2 changed files with 22 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2008-11-04 Stefan Kost <ensonic@users.sf.net>
* gst/modplug/gstmodplug.cc:
Send tag event. Fixes #559286.
2008-11-04 Zaheer Abbas Merali <zaheerabbas at merali dot org>
patch by: Sebastian Pölsterl

View file

@ -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;