$NetBSD: patch-ab,v 1.5 2005/08/05 12:58:49 tonio Exp $

--- audioplayer.c.orig	2005-08-04 11:07:43.000000000 +0200
+++ audioplayer.c	2005-08-04 11:10:48.000000000 +0200
@@ -167,11 +167,11 @@
 
 static void cb_error (__UNUSED__ GstElement *gstelement,
                       __UNUSED__ GstElement *arg1,
-                      __UNUSED__ gpointer arg2,
-                      gchar *arg3,
+                      GError *err,
+                      gchar *dbg_msg,
                       __UNUSED__ gpointer user_data)
 {
-    fprintf(stderr, "an error occured:\n%s\n\n", arg3);
+    fprintf(stderr, "an error occured:\n%s (%s)\n\n", err->message, dbg_msg);
 }
 
 static void cb_iterate(GstBin *bin, __UNUSED__ gpointer data)
@@ -197,6 +197,7 @@
     /* remove the source and decoder from the pipeline */
     gst_bin_remove_many (GST_BIN (pipeline_thread), srcelem, decoder, NULL);
 
+    gst_element_set_state(pipeline_thread, GST_STATE_NULL);
     gst_object_unref(GST_OBJECT(pipeline_thread));
 }
 
