Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus-cd-burner/ChangeLog,v
retrieving revision 1.562
diff -p -u -r1.562 ChangeLog
--- ChangeLog	17 Jan 2006 04:06:37 -0000	1.562
+++ ChangeLog	18 Jan 2006 01:36:21 -0000
@@ -1,3 +1,10 @@
+2006-01-17  William Jon McCann  <mccann@jhu.edu>
+
+	* nautilus-burn-drive.c (nautilus_burn_drive_hal_get_media_size) 
+	(nautilus_burn_drive_get_media_size): Use HAL disc capacity.
+
+	Fixes #327461.
+
 2006-01-16  William Jon McCann  <mccann@jhu.edu>
 
 	* nautilus-cd-burner.c (refresh_dialog): Off by one error
Index: nautilus-burn-drive.c
===================================================================
RCS file: /cvs/gnome/nautilus-cd-burner/nautilus-burn-drive.c,v
retrieving revision 1.49
diff -p -u -r1.49 nautilus-burn-drive.c
--- nautilus-burn-drive.c	17 Jan 2006 03:29:09 -0000	1.49
+++ nautilus-burn-drive.c	18 Jan 2006 01:36:22 -0000
@@ -1264,6 +1264,72 @@ try_media_size_from_type (NautilusBurnDr
 	return size;
 }
 
+#ifdef USE_HAL
+static gint64
+nautilus_burn_drive_hal_get_media_size (NautilusBurnDrive *drive)
+{
+	gint64         size;
+	guint64        res;
+	LibHalContext *ctx;
+	char         **device_names;
+	int            num_devices = -1;
+	DBusError      error;
+
+	size = -1;
+
+	if (drive->priv == NULL || drive->priv->udi == NULL) {
+		goto done;
+	}
+		
+	ctx = drive->priv->ctx;
+
+	if (ctx == NULL) {
+		goto done;
+	}
+
+	dbus_error_init (&error);
+
+	device_names = libhal_manager_find_device_string_match (ctx, 
+								"info.parent",
+								drive->priv->udi,
+								&num_devices,
+								&error);
+
+	if (dbus_error_is_set (&error)) {
+		g_warning ("%s\n", error.message);
+		dbus_error_free (&error);
+		libhal_free_string_array (device_names);
+		goto done;
+	}
+
+	if (num_devices <= 0) {
+		libhal_free_string_array (device_names);
+		goto done;
+	}
+
+	dbus_error_init (&error);
+	res = libhal_device_get_property_uint64 (ctx, 
+						 device_names [0],
+						 "volume.disc.capacity",
+						 &error);
+
+	if (dbus_error_is_set (&error)) {
+		g_warning ("%s\n", error.message);
+		dbus_error_free (&error);
+		libhal_free_string_array (device_names);
+				
+		goto done;
+	}
+
+	size = (gint64) res;
+
+	libhal_free_string_array (device_names);
+
+ done:
+	return size;
+}
+#endif
+
 /**
  * nautilus_burn_drive_get_media_size:
  * @drive: #NautilusBurnDrive
@@ -1285,9 +1351,12 @@ nautilus_burn_drive_get_media_size (Naut
 	g_return_val_if_fail (drive != NULL, NAUTILUS_BURN_MEDIA_SIZE_UNKNOWN);
 
 #ifdef USE_HAL
-	size = nautilus_burn_drive_get_media_size_from_path (drive->device);
+	size = nautilus_burn_drive_hal_get_media_size (drive);
 	if (size < 0) {
-		size = try_media_size_from_type (drive);
+		size = nautilus_burn_drive_get_media_size_from_path (drive->device);
+		if (size < 0) {
+			size = try_media_size_from_type (drive);
+		}
 	}
 #else
 	size = nautilus_burn_drive_get_media_size_from_path (drive->device);
