[brasero] Don't flag DVD-RW as unformatted as they should be considered as in sequential recording mode



commit 7c61788c8a01cc53669a63dd0da37057022e3ff1
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Fri Aug 21 14:40:34 2009 +0200

    Don't flag DVD-RW as unformatted as they should be considered as in sequential recording mode

 libbrasero-media/brasero-media.c  |    7 +++++--
 libbrasero-media/brasero-medium.c |    6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/libbrasero-media/brasero-media.c b/libbrasero-media/brasero-media.c
index 869f585..3d46f2f 100644
--- a/libbrasero-media/brasero-media.c
+++ b/libbrasero-media/brasero-media.c
@@ -76,9 +76,12 @@ brasero_media_new_status (GSList *retval,
 						    BRASERO_MEDIUM_BLANK);
 
 		/* NOTE about BR-R they can be "formatted" but they are never
-		 * unformatted since by default they'll be used as sequential */
+		 * unformatted since by default they'll be used as sequential.
+		 * We don't consider DVD-RW as unformatted as in this case
+		 * they are treated as DVD-RW in sequential mode and therefore
+		 * don't require any formatting. */
 		if (!(media & BRASERO_MEDIUM_RAM)
-		&&   (BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVD|BRASERO_MEDIUM_REWRITABLE)
+		&&   (BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_DVDRW_PLUS)
 		||    BRASERO_MEDIUM_IS (media, BRASERO_MEDIUM_BD|BRASERO_MEDIUM_REWRITABLE))) {
 			if (type & BRASERO_MEDIUM_UNFORMATTED)
 				retval = brasero_media_add_to_list (retval,
diff --git a/libbrasero-media/brasero-medium.c b/libbrasero-media/brasero-medium.c
index de8873f..4f33abc 100644
--- a/libbrasero-media/brasero-medium.c
+++ b/libbrasero-media/brasero-medium.c
@@ -1124,7 +1124,9 @@ brasero_medium_get_capacity_DVD_RW (BraseroMedium *self,
 	current = hdr->max_caps;
 	if (!(current->type & BRASERO_SCSI_DESC_FORMATTED)) {
 		BRASERO_MEDIA_LOG ("Unformatted media");
-		priv->info |= BRASERO_MEDIUM_UNFORMATTED;
+		/* If it's sequential, it's not unformatted */
+		if (!(priv->info & BRASERO_MEDIUM_SEQUENTIAL))
+			priv->info |= BRASERO_MEDIUM_UNFORMATTED;
 
 		/* if unformatted, a DVD-RAM will return its maximum formattable
 		 * size in this descriptor and that's what we're looking for. */
@@ -1674,7 +1676,7 @@ brasero_medium_track_set_leadout_DVDR_blank (BraseroMedium *self,
 	 * they are blank. */
 	current = hdr->max_caps;
 	if (current->type & BRASERO_SCSI_DESC_FORMATTED) {
-		BRASERO_MEDIA_LOG ("Unformatted medium");
+		BRASERO_MEDIA_LOG ("Formatted medium");
 		g_free (hdr);
 		return FALSE;
 	}



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