sound-juicer r2284 - in trunk: . libjuicer
- From: hadess svn gnome org
- To: svn-commits-list gnome org
- Subject: sound-juicer r2284 - in trunk: . libjuicer
- Date: Thu, 4 Sep 2008 00:02:27 +0000 (UTC)
Author: hadess
Date: Thu Sep 4 00:02:27 2008
New Revision: 2284
URL: http://svn.gnome.org/viewvc/sound-juicer?rev=2284&view=rev
Log:
2008-09-04 Bastien Nocera <hadess hadess net>
* libjuicer/sj-metadata-getter.c (sj_metadata_getter_set_cdrom):
* libjuicer/sj-metadata.c (sj_metadata_helper_check_media):
Move in 2 pieces of code from Rhythmbox (compile-time option
of using totem-pl-parser for device checking, Solaris device
work-around)
Modified:
trunk/ChangeLog
trunk/libjuicer/sj-metadata-getter.c
trunk/libjuicer/sj-metadata.c
Modified: trunk/libjuicer/sj-metadata-getter.c
==============================================================================
--- trunk/libjuicer/sj-metadata-getter.c (original)
+++ trunk/libjuicer/sj-metadata-getter.c Thu Sep 4 00:02:27 2008
@@ -114,8 +114,14 @@
priv = GETTER_PRIVATE (mdg);
- if (priv->cdrom)
- g_free (priv->cdrom);
+ g_free (priv->cdrom);
+
+#if defined (sun) && defined (__SVR4)
+ if (g_str_has_prefix (device, "/dev/dsk/")) {
+ priv->cdrom = g_strdup_printf ("/dev/rdsk/%s", device + strlen ("/dev/dsk/"));
+ return;
+ }
+#endif
priv->cdrom = g_strdup (device);
}
Modified: trunk/libjuicer/sj-metadata.c
==============================================================================
--- trunk/libjuicer/sj-metadata.c (original)
+++ trunk/libjuicer/sj-metadata.c Thu Sep 4 00:02:27 2008
@@ -26,6 +26,8 @@
#include <unistd.h>
#include <glib/gi18n.h>
#include <nautilus-burn.h>
+#else
+#include <totem-disc.h>
#endif /* USE_TOTEM_PL_PARSER */
#include "sj-metadata.h"
@@ -160,6 +162,7 @@
gboolean
sj_metadata_helper_check_media (const char *cdrom, GError **error)
{
+#ifndef USE_TOTEM_PL_PARSER
NautilusBurnMediaType type;
NautilusBurnDriveMonitor *monitor;
NautilusBurnDrive *drive;
@@ -191,6 +194,19 @@
return FALSE;
}
+#else
+ TotemDiscMediaType type;
+ GError *totem_error = NULL;
+
+ type = totem_cd_detect_type (priv->cdrom, &totem_error);
+
+ if (totem_error != NULL) {
+ error = g_set_error (error, SJ_ERROR, SJ_ERROR_CD_NO_MEDIA, _("Cannot read CD: %s"), totem_error->message);
+ g_error_free (totem_error);
+
+ return FALSE;
+ }
+#endif /* !USE_TOTEM_PL_PARSER */
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]