diff -ur app/gstappsrc.c app.patched/gstappsrc.c
--- app/gstappsrc.c	2007-03-02 12:57:38.000000000 +0100
+++ app.patched/gstappsrc.c	2007-03-02 20:18:08.000000000 +0100
@@ -17,15 +17,10 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
 
 #include <gst/gst.h>
 #include <gst/base/gstpushsrc.h>
 
-#include <unistd.h>
-#include <fcntl.h>
 #include <string.h>
 
 #include "gstappsrc.h"
@@ -39,22 +34,12 @@
     "FIXME",
     "autogenerated by makefilter");
 
-enum
-{
-  PROP_0
-};
-
 static GstStaticPadTemplate gst_app_src_template =
 GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS_ANY);
-
-static void gst_app_src_set_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec);
-static void gst_app_src_get_property (GObject * object, guint prop_id,
-    GValue * value, GParamSpec * pspec);
-static void gst_app_src_dispose (GObject * object);
+static void gst_app_src_finalize (GObject * object);
 static GstFlowReturn gst_app_src_create (GstPushSrc * psrc, GstBuffer ** buf);
 static gboolean gst_app_src_start (GstBaseSrc * psrc);
 static gboolean gst_app_src_stop (GstBaseSrc * psrc);
@@ -67,8 +52,6 @@
 {
   GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
 
-  //GObjectClass *gobject_class = G_OBJECT_CLASS (g_class);
-
   GST_DEBUG_CATEGORY_INIT (app_src_debug, "appsrc", 0, "appsrc element");
 
   gst_element_class_set_details (element_class, &app_src_details);
@@ -85,21 +68,22 @@
   GstPushSrcClass *pushsrc_class = (GstPushSrcClass *) klass;
   GstBaseSrcClass *basesrc_class = (GstBaseSrcClass *) klass;
 
-  gobject_class->set_property = gst_app_src_set_property;
-  gobject_class->get_property = gst_app_src_get_property;
-  gobject_class->dispose = gst_app_src_dispose;
+  gobject_class->finalize = gst_app_src_finalize;
 
   pushsrc_class->create = gst_app_src_create;
+
   basesrc_class->start = gst_app_src_start;
   basesrc_class->stop = gst_app_src_stop;
   basesrc_class->unlock = gst_app_src_unlock;
 }
 
 static void
-gst_app_src_dispose (GObject * obj)
+gst_app_src_finalize (GObject * obj)
 {
   GstAppSrc *appsrc = GST_APP_SRC (obj);
 
+  if (appsrc->caps)
+    gst_caps_unref (appsrc->caps);
   g_mutex_free (appsrc->mutex);
   g_cond_free (appsrc->cond);
   g_queue_free (appsrc->queue);
@@ -108,41 +92,12 @@
 static void
 gst_app_src_init (GstAppSrc * appsrc, GstAppSrcClass * klass)
 {
+  appsrc->caps = NULL;
   appsrc->mutex = g_mutex_new ();
   appsrc->cond = g_cond_new ();
   appsrc->queue = g_queue_new ();
 }
 
-static void
-gst_app_src_set_property (GObject * object, guint prop_id,
-    const GValue * value, GParamSpec * pspec)
-{
-  GstAppSrc *appsrc = GST_APP_SRC (object);
-
-  GST_OBJECT_LOCK (appsrc);
-  switch (prop_id) {
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-  GST_OBJECT_UNLOCK (appsrc);
-}
-
-static void
-gst_app_src_get_property (GObject * object, guint prop_id, GValue * value,
-    GParamSpec * pspec)
-{
-  GstAppSrc *appsrc = GST_APP_SRC (object);
-
-  GST_OBJECT_LOCK (appsrc);
-  switch (prop_id) {
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-  }
-  GST_OBJECT_UNLOCK (appsrc);
-}
-
 static gboolean
 gst_app_src_start (GstBaseSrc * psrc)
 {
@@ -162,8 +117,6 @@
 static gboolean
 gst_app_src_stop (GstBaseSrc * psrc)
 {
-  //GstAppSrc *appsrc = GST_APP_SRC(psrc);
-
   return TRUE;
 }
 
@@ -172,8 +125,10 @@
 {
   GstAppSrc *appsrc = GST_APP_SRC (psrc);
 
+  g_mutex_lock (appsrc->mutex);
   appsrc->unlock = TRUE;
-  g_cond_signal (appsrc->cond);
+  g_cond_broadcast (appsrc->cond);
+  g_mutex_unlock (appsrc->mutex);
 
   return TRUE;
 }
@@ -190,7 +145,8 @@
     if (!g_queue_is_empty (appsrc->queue)) {
       *buf = g_queue_pop_head (appsrc->queue);
 
-      gst_buffer_set_caps (*buf, appsrc->caps);
+      if (appsrc->caps)
+	gst_buffer_set_caps (*buf, appsrc->caps);
 
       ret = GST_FLOW_OK;
       break;
@@ -205,6 +161,11 @@
       /* FIXME: I don't really know how to do this */
       break;
     }
+    if (appsrc->unlock) {
+      ret = GST_FLOW_WRONG_STATE;
+      break;
+    }
+
     g_cond_wait (appsrc->cond, appsrc->mutex);
   }
 
@@ -219,17 +180,35 @@
 void
 gst_app_src_push_buffer (GstAppSrc * appsrc, GstBuffer * buffer)
 {
+  g_return_if_fail (GST_IS_APP_SRC (appsrc));
+
   g_mutex_lock (appsrc->mutex);
 
   g_queue_push_tail (appsrc->queue, buffer);
 
-  g_cond_signal (appsrc->cond);
+  g_cond_broadcast (appsrc->cond);
   g_mutex_unlock (appsrc->mutex);
 }
 
 void
+gst_app_src_push_data (GstAppSrc * appsrc, gconstpointer data, guint length)
+{
+  GstBuffer *buffer = NULL;
+
+  g_return_if_fail (GST_IS_APP_SRC (appsrc));
+  g_return_if_fail (data != NULL);
+  g_return_if_fail (length > 0);
+
+  buffer = gst_buffer_new_and_alloc (length);
+  memcpy (GST_BUFFER_MALLOCDATA (buffer), data, length);
+  gst_app_src_push_buffer (appsrc, buffer);
+  gst_buffer_unref (buffer);
+}
+
+void
 gst_app_src_set_caps (GstAppSrc * appsrc, GstCaps * caps)
 {
+  g_return_if_fail (GST_IS_APP_SRC (appsrc));
   gst_caps_replace (&appsrc->caps, caps);
 }
 
@@ -238,6 +217,8 @@
 {
   GstBuffer *buffer;
 
+  g_return_if_fail (GST_IS_APP_SRC (appsrc));
+
   g_mutex_lock (appsrc->mutex);
 
   while ((buffer = g_queue_pop_head (appsrc->queue))) {
@@ -252,6 +233,8 @@
 void
 gst_app_src_end_of_stream (GstAppSrc * appsrc)
 {
+  g_return_if_fail (GST_IS_APP_SRC (appsrc));
+
   g_mutex_lock (appsrc->mutex);
 
   appsrc->end_of_stream = TRUE;
diff -ur app/gstappsrc.h app.patched/gstappsrc.h
--- app/gstappsrc.h	2007-03-02 12:57:38.000000000 +0100
+++ app.patched/gstappsrc.h	2007-03-02 15:50:18.000000000 +0100
@@ -23,6 +23,8 @@
 #include <gst/gst.h>
 #include <gst/base/gstpushsrc.h>
 
+G_BEGIN_DECLS
+
 #define GST_TYPE_APP_SRC \
   (gst_app_src_get_type())
 #define GST_APP_SRC(obj) \
@@ -62,10 +64,12 @@
 
 
 void gst_app_src_push_buffer (GstAppSrc *appsrc, GstBuffer *buffer);
+void gst_app_src_push_data (GstAppSrc *appsrc, gconstpointer data, guint length);
 void gst_app_src_set_caps (GstAppSrc *appsrc, GstCaps *caps);
 void gst_app_src_flush (GstAppSrc *appsrc);
 void gst_app_src_end_of_stream (GstAppSrc *appsrc);
 
+G_END_DECLS
 
 #endif
 
Les fichiers binaires app/gstappsrc.o et app.patched/gstappsrc.o sont différents.
