? help/el/.xml2po.mo
? help/el/rhythmbox.xml
? plugins/magnatune/Makefile
? plugins/magnatune/Makefile.in
? plugins/magnatune/magnatune.rb-plugin
? plugins/magnatune/magnatune/Makefile
? plugins/magnatune/magnatune/Makefile.in
Index: lib/rb-debug.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-debug.c,v
retrieving revision 1.17
diff -p -u -r1.17 rb-debug.c
--- lib/rb-debug.c	11 Aug 2006 10:04:19 -0000	1.17
+++ lib/rb-debug.c	8 Dec 2006 20:03:26 -0000
@@ -44,6 +44,20 @@ static const char *debug_match = NULL;
 /* Our own funky debugging function, should only be used when something
  * is not going wrong, if something *is* wrong use g_warning.
  */
+gboolean
+rb_debug_is_enabled_real (const char *func,
+			  const char *file,
+			  const int   line)
+{
+	gboolean enabled;
+
+	enabled = (debug_match != NULL
+		   && (debug_match == debug_everything
+		       || (strstr (file, debug_match) != NULL)
+		       || (strstr (func, debug_match) != NULL)));
+
+	return enabled;
+}
 void
 rb_debug_real (const char *func,
 	       const char *file,
@@ -56,11 +70,9 @@ rb_debug_real (const char *func,
 	char str_time[255];
 	time_t the_time;
 
-	if (debug_match == NULL ||
-	   (debug_match != debug_everything &&
-	   (strstr (file, debug_match) == NULL) &&
-	   (strstr (func, debug_match) == NULL)))
+	if (! rb_debug_is_enabled_real (func, file, line)) {
 		return;
+	}
 
 	va_start (args, format);
 
@@ -81,7 +93,7 @@ rb_debug_init (gboolean debug)
 	rb_debug_init_match (debug ? debug_everything : NULL);
 }
 
-void 
+void
 rb_debug_init_match (const char *match)
 {
 	guint i;
@@ -182,7 +194,7 @@ RBProfiler *
 rb_profiler_new (const char *name)
 {
 	RBProfiler *profiler;
-	
+
 	if (debug_match == NULL)
 		return NULL;
 
Index: lib/rb-debug.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/lib/rb-debug.h,v
retrieving revision 1.12
diff -p -u -r1.12 rb-debug.h
--- lib/rb-debug.h	9 Jul 2006 13:39:21 -0000	1.12
+++ lib/rb-debug.h	8 Dec 2006 20:03:26 -0000
@@ -30,22 +30,26 @@ G_BEGIN_DECLS
 
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 #define rb_debug(...) rb_debug_real (__func__, __FILE__, __LINE__, TRUE, __VA_ARGS__)
+#define rb_debug_is_enabled(...) rb_debug_is_enabled_real (__func__, __FILE__, __LINE__)
 #elif defined(__GNUC__) && __GNUC__ >= 3
 #define rb_debug(...) rb_debug_real (__FUNCTION__, __FILE__, __LINE__, TRUE, __VA_ARGS__)
+#define rb_debug_is_enabled(...) rb_debug_is_enabled_real (__FUNCTION__, __FILE__, __LINE__)
 #else
 #define rb_debug
+#define rb_debug_is_enabled
 #endif
 
-void rb_debug_init             (gboolean debug);
-void rb_debug_init_match       (const char *match);
-
-void rb_debug_real             (const char *func,
-				const char *file,
-				int line,
-				gboolean newline,
-				const char *format, ...) G_GNUC_PRINTF (5, 6);
-
-void rb_debug_stop_in_debugger (void);
+void     rb_debug_init             (gboolean debug);
+void     rb_debug_init_match       (const char *match);
+gboolean rb_debug_is_enabled_real  (const char *func,
+                                    const char *file,
+                                    int line);
+void     rb_debug_real             (const char *func,
+                                    const char *file,
+                                    int line,
+                                    gboolean newline,
+                                    const char *format, ...) G_GNUC_PRINTF (5, 6);
+void     rb_debug_stop_in_debugger (void);
 
 typedef struct RBProfiler RBProfiler;
 
Index: metadata/rb-metadata-dbus-client.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/metadata/rb-metadata-dbus-client.c,v
retrieving revision 1.9
diff -p -u -r1.9 rb-metadata-dbus-client.c
--- metadata/rb-metadata-dbus-client.c	11 Aug 2006 09:17:29 -0000	1.9
+++ metadata/rb-metadata-dbus-client.c	8 Dec 2006 20:03:26 -0000
@@ -1,4 +1,5 @@
-/*
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
  *  Copyright (C) 2006 Jonathan Matthew <jonathan@kaolin.hn.org>
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -66,11 +67,12 @@ static DBusConnection *dbus_connection =
 static GPid metadata_child = 0;
 static GMainContext *main_context = NULL;
 static GStaticMutex conn_mutex = G_STATIC_MUTEX_INIT;
+static int error_watch_id;
 
 struct RBMetaDataPrivate
 {
-	char *uri;
-	char *mimetype;
+	char       *uri;
+	char       *mimetype;
 	GHashTable *metadata;
 };
 
@@ -80,6 +82,7 @@ static void
 rb_metadata_class_init (RBMetaDataClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
 	object_class->finalize = rb_metadata_finalize;
 
 	g_type_class_add_private (object_class, sizeof (RBMetaDataPrivate));
@@ -99,8 +102,10 @@ rb_metadata_finalize (GObject *object)
 	RBMetaData *md;
 
 	md = RB_METADATA (object);
+
 	g_free (md->priv->uri);
 	g_free (md->priv->mimetype);
+
 	if (md->priv->metadata)
 		g_hash_table_destroy (md->priv->metadata);
 
@@ -137,6 +142,11 @@ kill_metadata_service (void)
 		g_spawn_close_pid (metadata_child);
 		metadata_child = 0;
 	}
+
+        if (error_watch_id != 0) {
+                g_source_remove (error_watch_id);
+                error_watch_id = 0;
+        }
 }
 
 static gboolean
@@ -172,25 +182,54 @@ ping_metadata_service (GError **error)
 	return TRUE;
 }
 
+/* just for debugging */
+static gboolean
+error_watch (GIOChannel   *source,
+             GIOCondition  condition,
+             gpointer      data)
+{
+        gboolean finished = FALSE;
+
+        if (condition & G_IO_IN) {
+                GIOStatus status;
+                GError   *error = NULL;
+                char     *line;
+
+                line = NULL;
+                status = g_io_channel_read_line (source, &line, NULL, NULL, &error);
+
+                switch (status) {
+                case G_IO_STATUS_NORMAL:
+                        rb_debug ("metadata error output: %s", g_strchomp (line));
+                        break;
+                case G_IO_STATUS_EOF:
+                        finished = TRUE;
+                        break;
+                case G_IO_STATUS_ERROR:
+                        finished = TRUE;
+                        rb_debug ("Error reading from child: %s\n", error->message);
+                        return FALSE;
+                case G_IO_STATUS_AGAIN:
+                default:
+                        break;
+                }
+                g_free (line);
+        } else if (condition & G_IO_HUP) {
+                finished = TRUE;
+        }
+
+        if (finished) {
+                error_watch_id = 0;
+                return FALSE;
+        }
+
+        return TRUE;
+}
+
 static gboolean
 start_metadata_service (GError **error)
 {
-	/*
-	 * Normally, we find the metadata helper in the libexec dir,
-	 * but when --enable-uninstalled-build is specified, we look
-	 * in the directory it's built in.
-	 */
-	char *argv[] = {
-#ifdef METADATA_UNINSTALLED_DIR
-		METADATA_UNINSTALLED_DIR "/rhythmbox-metadata",
-#else
-		LIBEXEC_DIR "/rhythmbox-metadata",
-#endif
-		"unix:tmpdir=/tmp", NULL
-	};
 	DBusError dbus_error = {0,};
-	GIOChannel *stdout_channel;
-	GIOStatus status;
 	gchar *dbus_address = NULL;
 
 	if (dbus_connection) {
@@ -217,28 +256,73 @@ start_metadata_service (GError **error)
 	}
 
 	if (dbus_address == NULL) {
-		gint metadata_stdout;
+		GPtrArray  *argv;
+		GError     *local_error;
+		GIOChannel *stdout_channel;
+		GIOChannel *stderr_channel;
+		GIOStatus   status;
+		gboolean    res;
+		int         metadata_stdout;
+		int         metadata_stderr;
+
+		argv = g_ptr_array_new ();
+		/*
+		 * Normally, we find the metadata helper in the libexec dir,
+		 * but when --enable-uninstalled-build is specified, we look
+		 * in the directory it's built in.
+		 */
 
-		if (!g_spawn_async_with_pipes (NULL,
-					       argv,
-					       NULL,
-					       0,
-					       NULL, NULL,
-					       &metadata_child,
-					       NULL,
-					       &metadata_stdout,
-					       NULL,
-					       error)) {
+#ifdef METADATA_UNINSTALLED_DIR
+		g_ptr_array_add (argv, METADATA_UNINSTALLED_DIR "/rhythmbox-metadata");
+#else
+		g_ptr_array_add (argv, LIBEXEC_DIR "/rhythmbox-metadata");
+#endif
+
+		if (rb_debug_is_enabled ()) {
+			g_ptr_array_add (argv, "--debug");
+		}
+
+		g_ptr_array_add (argv, "unix:tmpdir=/tmp");
+		g_ptr_array_add (argv, NULL);
+
+		local_error = NULL;
+		res = g_spawn_async_with_pipes (NULL,
+						(char **)argv->pdata,
+						NULL,
+						0,
+						NULL, NULL,
+						&metadata_child,
+						NULL,
+						&metadata_stdout,
+						&metadata_stderr,
+						&local_error);
+
+		g_ptr_array_free (argv, TRUE);
+
+		if (! res) {
+			g_propagate_error (error, local_error);
 			return FALSE;
 		}
 
 		stdout_channel = g_io_channel_unix_new (metadata_stdout);
+		stderr_channel = g_io_channel_unix_new (metadata_stderr);
+
 		status = g_io_channel_read_line (stdout_channel, &dbus_address, NULL, NULL, error);
 		g_io_channel_unref (stdout_channel);
 		if (status != G_IO_STATUS_NORMAL) {
 			kill_metadata_service ();
 			return FALSE;
 		}
+
+		g_io_channel_set_close_on_unref (stderr_channel, TRUE);
+		g_io_channel_set_flags (stderr_channel,
+					g_io_channel_get_flags (stderr_channel) | G_IO_FLAG_NONBLOCK,
+					NULL);
+		error_watch_id = g_io_add_watch (stderr_channel,
+						 G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
+						 error_watch,
+						 NULL);
+		g_io_channel_unref (stderr_channel);
 
 		g_strchomp (dbus_address);
 		rb_debug ("Got metadata helper D-BUS address %s", dbus_address);
