rhythmbox r5940 - in trunk: . plugins/audiocd



Author: jmatthew
Date: Tue Sep 23 06:59:55 2008
New Revision: 5940
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5940&view=rev

Log:
2008-09-23  Jonathan Matthew  <jonathan d14n org>

	* plugins/audiocd/rb-audiocd-source.c:
	(rb_audiocd_is_mount_audiocd):
	Don't crash if g_mount_guess_content_type_sync fails.


Modified:
   trunk/ChangeLog
   trunk/plugins/audiocd/rb-audiocd-source.c

Modified: trunk/plugins/audiocd/rb-audiocd-source.c
==============================================================================
--- trunk/plugins/audiocd/rb-audiocd-source.c	(original)
+++ trunk/plugins/audiocd/rb-audiocd-source.c	Tue Sep 23 06:59:55 2008
@@ -718,16 +718,21 @@
 #if GLIB_CHECK_VERSION(2,17,7)
 	char **types;
 	guint i;
+	GError *error = NULL;
 
-	types = g_mount_guess_content_type_sync (mount, FALSE, NULL, NULL);
-	for (i = 0; types[i] != NULL; i++) {
-		if (g_str_equal (types[i], "x-content/audio-cdda") != FALSE) {
-			result = TRUE;
-			break;
+	types = g_mount_guess_content_type_sync (mount, FALSE, NULL, &error);
+	if (types == NULL) {
+		rb_debug ("error guessing content type: %s", error->message);
+		g_clear_error (&error);
+	} else {
+		for (i = 0; types[i] != NULL; i++) {
+			if (g_str_equal (types[i], "x-content/audio-cdda") != FALSE) {
+				result = TRUE;
+				break;
+			}
 		}
+		g_strfreev (types);
 	}
-
-	g_strfreev (types);
 #else
 	GFile *file;
 	



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]