--- /home/ensonic/projects/gstreamer/gst-plugins-good/gst/wavparse/gstwavparse.c	2008-11-24 09:19:51.000000000 +0200
+++ ./gst/wavparse/gstwavparse.c	2008-12-11 16:39:54.000000000 +0200
@@ -101,11 +101,39 @@ GST_STATIC_PAD_TEMPLATE ("wavparse_sink"
     GST_STATIC_CAPS ("audio/x-wav")
     );
 
-#define DEBUG_INIT(bla) \
+
+static void
+gst_wavparse_tagreader_mode (GstTagReader *reader,
+                             GstTagReadingMode mode)
+{
+  GstWavParse * wav;
+  wav = GST_WAVPARSE (reader);
+  GST_DEBUG_OBJECT (wav, "tag reading mode: %d", mode);
+  wav->tagread_mode = mode;
+}
+
+static void
+gst_wavparse_tagreader_interface_init (GstTagReaderInterface * iface)
+{
+  /* set up the interface hooks */
+  iface->tag_reading_mode = gst_wavparse_tagreader_mode;
+}
+
+static void
+gst_wavparse_do_init (GType type)
+{
+  static const GInterfaceInfo tr_iface_info = {
+    (GInterfaceInitFunc) gst_wavparse_tagreader_interface_init,
+     NULL,
+     NULL,
+  };
+
+  g_type_add_interface_static (type, GST_TYPE_TAGREADER, &tr_iface_info);
   GST_DEBUG_CATEGORY_INIT (wavparse_debug, "wavparse", 0, "WAV parser");
+}
 
 GST_BOILERPLATE_FULL (GstWavParse, gst_wavparse, GstElement,
-    GST_TYPE_ELEMENT, DEBUG_INIT);
+    GST_TYPE_ELEMENT, gst_wavparse_do_init);
 
 static void
 gst_wavparse_base_init (gpointer g_class)
@@ -1648,6 +1559,10 @@ gst_wavparse_add_src_pad (GstWavParse * 
     gst_element_found_tags_for_pad (GST_ELEMENT_CAST (wav), wav->srcpad,
         wav->tags);
     wav->tags = NULL;
+
+    if  (wav->tagread_mode == GST_TAGREAD_MODE_TAGS) {
+      gst_tagreader_done (GST_TAGREADER (wav));
+    }
   }
 }
 
--- /home/ensonic/projects/gstreamer/gst-plugins-good/gst/wavparse/gstwavparse.h	2007-09-04 13:41:06.000000000 +0300
+++ ./gst/wavparse/gstwavparse.h	2008-08-11 15:57:11.000000000 +0300
@@ -27,6 +27,7 @@
 #include "gst/riff/riff-ids.h"
 #include "gst/riff/riff-read.h"
 #include <gst/base/gstadapter.h>
+#include <gst/interfaces/tagreader.h>
 
 G_BEGIN_DECLS
 
@@ -116,6 +117,8 @@ struct _GstWavParse {
   gboolean first;
   /* discont after seek */
   gboolean discont;
+  /* tag reading mode */
+  GstTagReadingMode tagread_mode;
 };
 
 struct _GstWavParseClass {
