--- /home/ensonic/projects/gstreamer/gst-plugins-ugly/gst/mpegaudioparse//gstmpegaudioparse.c	2008-12-11 13:33:31.000000000 +0200
+++ ./src/gstmpegaudioparse.c	2008-12-11 16:39:38.000000000 +0200
@@ -136,14 +129,45 @@ mp3parse_total_bytes (GstMPEGAudioParse 
 static gboolean
 mp3parse_total_time (GstMPEGAudioParse * mp3parse, GstClockTime * total);
 
-GST_BOILERPLATE (GstMPEGAudioParse, gst_mp3parse, GstElement, GST_TYPE_ELEMENT);
+
+static void
+gst_mp3parse_tagreader_mode (GstTagReader *reader,
+                             GstTagReadingMode mode)
+{
+  GstMPEGAudioParse * mp3parse;
+  mp3parse = GST_MP3PARSE (reader);
+  GST_DEBUG_OBJECT (mp3parse, "tag reading mode: %d", mode);
+  mp3parse->tagread_mode = mode;
+}
+
+static void
+gst_mp3parse_tagreader_interface_init (GstTagReaderInterface * iface)
+{
+  /* set up the interface hooks */
+  iface->tag_reading_mode = gst_mp3parse_tagreader_mode;
+}
+
+static void
+gst_mp3parse_do_init (GType type)
+{
+  static const GInterfaceInfo tr_iface_info = {
+    (GInterfaceInitFunc) gst_mp3parse_tagreader_interface_init,
+     NULL,
+     NULL,
+  };
+
+  g_type_add_interface_static (type, GST_TYPE_TAGREADER, &tr_iface_info);
+}
+
+GST_BOILERPLATE_FULL (GstMPEGAudioParse, gst_mp3parse, GstElement,
+                      GST_TYPE_ELEMENT, gst_mp3parse_do_init);
 
 #define GST_TYPE_MP3_CHANNEL_MODE (gst_mp3_channel_mode_get_type())
-static GType
+G_GNUC_UNUSED static GType
 gst_mp3_channel_mode_get_type (void)
 {
   static GType mp3_channel_mode_type = 0;
-
   static GEnumValue mp3_channel_mode[] = {
     {MP3_CHANNEL_MODE_UNKNOWN, "Unknown", "unknown"},
     {MP3_CHANNEL_MODE_MONO, "Mono", "mono"},
@@ -766,8 +778,8 @@ gst_mp3parse_emit_frame (GstMPEGAudioPar
     }
     mp3parse->last_posted_channel_mode = mode;
 
-    mode_enum =
-        g_enum_get_value (g_type_class_peek (GST_TYPE_MP3_CHANNEL_MODE), mode);
+    mode_enum = g_enum_get_value (g_type_class_ref (GST_TYPE_MP3_CHANNEL_MODE),
+        mp3parse->last_posted_channel_mode);
 
     gst_tag_list_add (taglist, GST_TAG_MERGE_REPLACE, GST_TAG_MODE,
         mode_enum->value_nick, NULL);
@@ -777,6 +789,10 @@ gst_mp3parse_emit_frame (GstMPEGAudioPar
   if (taglist) {
     gst_element_found_tags_for_pad (GST_ELEMENT (mp3parse),
         mp3parse->srcpad, taglist);
+
+    if (mp3parse->tagread_mode == GST_TAGREAD_MODE_TAGS) {
+      gst_tagreader_done (GST_TAGREADER (mp3parse));
+    }
   }
 
   /* We start pushing 9 frames earlier (29 frames for MPEG2) than
--- /home/ensonic/projects/gstreamer/gst-plugins-ugly/gst/mpegaudioparse//gstmpegaudioparse.h	2008-12-11 13:33:31.000000000 +0200
+++ ./src/gstmpegaudioparse.h	2008-12-11 13:36:37.000000000 +0200
@@ -24,6 +24,7 @@
 
 #include <gst/gst.h>
 #include <gst/base/gstadapter.h>
+#include <gst/interfaces/tagreader.h>
 
 G_BEGIN_DECLS
 
@@ -85,6 +86,9 @@ struct _GstMPEGAudioParse {
                          performed) */
   gboolean sent_codec_tag;
 
+  /* tag reading mode */
+  GstTagReadingMode  tagread_mode;
+
   /* VBR tracking */
   guint   avg_bitrate;
   guint64 bitrate_sum;
