[brasero] Force DAO for cue and cdrdao images so that cdrecord won't error out



commit 1caab3aefaebf73def72b06d9861922f212dde6e
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Sun Nov 22 11:30:59 2009 +0100

    Force DAO for cue and cdrdao images so that cdrecord won't error out

 libbrasero-burn/brasero-caps-session.c |   50 +++++++++++++++++++++++---------
 1 files changed, 36 insertions(+), 14 deletions(-)
---
diff --git a/libbrasero-burn/brasero-caps-session.c b/libbrasero-burn/brasero-caps-session.c
index e0dc277..76ac4c6 100644
--- a/libbrasero-burn/brasero-caps-session.c
+++ b/libbrasero-burn/brasero-caps-session.c
@@ -1579,22 +1579,44 @@ brasero_caps_get_flags_for_disc (BraseroBurnCaps *self,
 		return BRASERO_BURN_NOT_SUPPORTED;
 	}
 
-	/* RAW write mode should (must) only be used in this case */
-	if ((supported_flags & BRASERO_BURN_FLAG_RAW)
-	&&   input->type == BRASERO_TRACK_TYPE_IMAGE
-	&&   input->subtype.img_format == BRASERO_IMAGE_FORMAT_CLONE) {
-		supported_flags &= ~BRASERO_BURN_FLAG_DAO;
-		compulsory_flags &= ~BRASERO_BURN_FLAG_DAO;
-		compulsory_flags |= BRASERO_BURN_FLAG_RAW;
+	if (brasero_track_type_get_has_image (input)) {
+		BraseroImageFormat format;
+
+		format = brasero_track_type_get_image_format (input);
+		if (format == BRASERO_IMAGE_FORMAT_CUE
+		||  format == BRASERO_IMAGE_FORMAT_CDRDAO) {
+			if (supported_flags & BRASERO_BURN_FLAG_DAO)
+				compulsory_flags |= BRASERO_BURN_FLAG_DAO;
+			else
+				return BRASERO_BURN_NOT_SUPPORTED;
+		}
+		else if (format == BRASERO_IMAGE_FORMAT_CLONE) {
+			/* RAW write mode should (must) only be used in this case */
+			if (supported_flags & BRASERO_BURN_FLAG_RAW) {
+				supported_flags &= ~BRASERO_BURN_FLAG_DAO;
+				compulsory_flags &= ~BRASERO_BURN_FLAG_DAO;
+				compulsory_flags |= BRASERO_BURN_FLAG_RAW;
+			}
+			else
+				return BRASERO_BURN_NOT_SUPPORTED;
+		}
+		else
+			supported_flags &= ~BRASERO_BURN_FLAG_RAW;
+	}
+	else if (brasero_track_type_get_has_stream (input)) {
+		if (brasero_track_type_get_stream_format (input) & BRASERO_METADATA_INFO) {
+			/* In this case, DAO is compulsory if we want to write CD-TEXT */
+			if (supported_flags & BRASERO_BURN_FLAG_DAO)
+				compulsory_flags |= BRASERO_BURN_FLAG_DAO;
+			else
+				return BRASERO_BURN_NOT_SUPPORTED;
+		}
 	}
-	else
-		supported_flags &= ~BRASERO_BURN_FLAG_RAW;
 
-	if ((supported_flags & BRASERO_BURN_FLAG_DAO)
-	&&   brasero_track_type_get_has_stream (input)
-	&&  (input->subtype.img_format & BRASERO_METADATA_INFO)) {
-		/* In this case, DAO is compulsory if we want to write CD-TEXT */
-		compulsory_flags |= BRASERO_BURN_FLAG_DAO;
+	if (compulsory_flags & BRASERO_BURN_FLAG_DAO) {
+		/* unlikely */
+		compulsory_flags &= ~BRASERO_BURN_FLAG_RAW;
+		supported_flags &= ~BRASERO_BURN_FLAG_RAW;
 	}
 
 	if (io_flags & BRASERO_PLUGIN_IO_ACCEPT_PIPE) {



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