brasero r802 - in trunk: . src src/plugins/cdrtools



Author: philippr
Date: Thu May  8 18:45:57 2008
New Revision: 802
URL: http://svn.gnome.org/viewvc/brasero?rev=802&view=rev

Log:
	Fix crash introduced by recent changes

	* src/brasero-data-project.c (brasero_data_project_remove_real):
	* src/brasero-file-node.c (brasero_file_node_save_imported):
	* src/brasero-file-node.h:

Modified:
   trunk/ChangeLog
   trunk/src/brasero-data-project.c
   trunk/src/brasero-file-node.c
   trunk/src/brasero-file-node.h
   trunk/src/burn-process.c
   trunk/src/plugins/cdrtools/burn-cdrecord.c
   trunk/src/scsi-opcodes.h

Modified: trunk/src/brasero-data-project.c
==============================================================================
--- trunk/src/brasero-data-project.c	(original)
+++ trunk/src/brasero-data-project.c	Thu May  8 18:45:57 2008
@@ -1083,6 +1083,7 @@
 	BraseroDataProjectPrivate *priv;
 	BraseroDataProjectClass *klass;
 	BraseroFileNode *former_parent;
+	BraseroFileTreeStats *stats;
 	guint former_position;
 
 	priv = BRASERO_DATA_PROJECT_PRIVATE (self);
@@ -1100,14 +1101,12 @@
 		klass->node_removed (self, former_parent, former_position, node);
 
 	/* save imported nodes in their parent structure or destroy it */
-	if (!node->is_imported) {
-		BraseroFileTreeStats *stats;
-
-		stats = brasero_file_node_get_tree_stats (priv->root, NULL);
+	stats = brasero_file_node_get_tree_stats (priv->root, NULL);
+	if (!node->is_imported)
 		brasero_file_node_destroy (node, stats);
-	}
 	else
 		brasero_file_node_save_imported (node,
+						 stats,
 						 former_parent,
 						 priv->sort_func);
 

Modified: trunk/src/brasero-file-node.c
==============================================================================
--- trunk/src/brasero-file-node.c	(original)
+++ trunk/src/brasero-file-node.c	Thu May  8 18:45:57 2008
@@ -1131,10 +1131,10 @@
 
 void
 brasero_file_node_save_imported (BraseroFileNode *node,
+				 BraseroFileTreeStats *stats,
 				 BraseroFileNode *parent,
 				 GCompareFunc sort_func)
 {
-	BraseroFileTreeStats *stats;
 	BraseroImport *import;
 
 	/* if it isn't imported return */
@@ -1158,8 +1158,6 @@
 		parent->has_import = TRUE;
 	}
 
-	stats = brasero_file_node_get_tree_stats (node, NULL);
-
 	/* unlink it and add it to the list */
 	brasero_file_node_unlink (node);
 	node->next = import->replaced;

Modified: trunk/src/brasero-file-node.h
==============================================================================
--- trunk/src/brasero-file-node.h	(original)
+++ trunk/src/brasero-file-node.h	Thu May  8 18:45:57 2008
@@ -267,6 +267,7 @@
 
 void
 brasero_file_node_save_imported (BraseroFileNode *node,
+				 BraseroFileTreeStats *stats,
 				 BraseroFileNode *parent,
 				 GCompareFunc sort_func);
 

Modified: trunk/src/burn-process.c
==============================================================================
--- trunk/src/burn-process.c	(original)
+++ trunk/src/burn-process.c	Thu May  8 18:45:57 2008
@@ -541,9 +541,30 @@
 			       GIOFunc function)
 {
 	GIOChannel *channel;
+	const gchar *term;
+	gint len = 0;
 
 	fcntl (pipe, F_SETFL, O_NONBLOCK);
 	channel = g_io_channel_unix_new (pipe);
+
+	term = g_io_channel_get_line_term (channel, &len);
+	if (term) {
+		gchar *tmp;
+
+		tmp = g_strdup_printf ("\b%s", term);
+g_print ("In here\n");
+		len ++;
+		g_io_channel_set_line_term (channel, tmp, len);
+		g_free (tmp);
+	}
+	else {
+		gchar *tmp;
+g_print ("KKKLKD\n");
+		tmp = g_strdup ("\n\r\b\0");
+		g_io_channel_set_line_term (channel, tmp, 4);
+		g_free (tmp);
+	}
+
 	g_io_channel_set_flags (channel,
 				g_io_channel_get_flags (channel) | G_IO_FLAG_NONBLOCK,
 				NULL);

Modified: trunk/src/plugins/cdrtools/burn-cdrecord.c
==============================================================================
--- trunk/src/plugins/cdrtools/burn-cdrecord.c	(original)
+++ trunk/src/plugins/cdrtools/burn-cdrecord.c	Thu May  8 18:45:57 2008
@@ -1019,6 +1019,15 @@
 				   BRASERO_MEDIUM_APPENDABLE|
 				   BRASERO_MEDIUM_HAS_AUDIO|
 				   BRASERO_MEDIUM_HAS_DATA;
+	const BraseroMedia dvd_media = BRASERO_MEDIUM_DVD|
+				       BRASERO_MEDIUM_PLUS|
+				       BRASERO_MEDIUM_SEQUENTIAL|
+				       BRASERO_MEDIUM_RESTRICTED|
+				       BRASERO_MEDIUM_WRITABLE|
+				       BRASERO_MEDIUM_REWRITABLE|
+				       BRASERO_MEDIUM_BLANK|
+				       BRASERO_MEDIUM_APPENDABLE|
+				       BRASERO_MEDIUM_HAS_DATA;
 	const BraseroMedia media_rw = BRASERO_MEDIUM_CD|
 				      BRASERO_MEDIUM_REWRITABLE|
 				      BRASERO_MEDIUM_APPENDABLE|
@@ -1026,6 +1035,7 @@
 				      BRASERO_MEDIUM_HAS_AUDIO|
 				      BRASERO_MEDIUM_HAS_DATA|
 				      BRASERO_MEDIUM_BLANK;
+	BraseroBurnResult result;
 	gchar *prog_name;
 	GSList *output;
 	GSList *input;
@@ -1037,21 +1047,22 @@
 			       "Philippe Rouquier",
 			       0);
 
-	/* First see if this plugin can be used, i.e. if cdrecord is in
-	 * the path */
-	prog_name = g_find_program_in_path ("cdrecord");
-	if (!prog_name) {
-		*error = g_strdup (_("cdrecord could not be found in the path"));
-		return BRASERO_BURN_ERR;
-	}
-	g_free (prog_name);
+	/* First see if this plugin can be used */
+	result = brasero_process_check_path ("cdrecord", error);
+	if (result != BRASERO_BURN_OK)
+		return result;
 
 	/* for recording */
-	output = brasero_caps_disc_new (media);
 	input = brasero_caps_image_new (BRASERO_PLUGIN_IO_ACCEPT_PIPE|
 					BRASERO_PLUGIN_IO_ACCEPT_FILE,
 					BRASERO_IMAGE_FORMAT_BIN);
 
+	/* wodim can burn all DVDs when it's ISOs */
+	output = brasero_caps_disc_new (dvd_media);
+	brasero_plugin_link_caps (plugin, output, input);
+	g_slist_free (output);
+
+	output = brasero_caps_disc_new (media);
 	brasero_plugin_link_caps (plugin, output, input);
 	g_slist_free (input);
 
@@ -1070,6 +1081,149 @@
 	g_slist_free (output);
 	g_slist_free (input);
 
+	/* For DVD-W and DVD-RW sequential
+	 * NOTE: DAO et MULTI are exclusive. */
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVD|
+				  BRASERO_MEDIUM_SEQUENTIAL|
+				  BRASERO_MEDIUM_WRITABLE|
+				  BRASERO_MEDIUM_REWRITABLE|
+				  BRASERO_MEDIUM_BLANK,
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_MULTI|
+				  BRASERO_BURN_FLAG_DUMMY|
+				  BRASERO_BURN_FLAG_NOGRACE,
+				  BRASERO_BURN_FLAG_NONE);
+
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVD|
+				  BRASERO_MEDIUM_SEQUENTIAL|
+				  BRASERO_MEDIUM_WRITABLE|
+				  BRASERO_MEDIUM_REWRITABLE|
+				  BRASERO_MEDIUM_BLANK,
+				  BRASERO_BURN_FLAG_DAO|
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_DUMMY|
+				  BRASERO_BURN_FLAG_NOGRACE,
+				  BRASERO_BURN_FLAG_NONE);
+
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVD|
+				  BRASERO_MEDIUM_SEQUENTIAL|
+				  BRASERO_MEDIUM_WRITABLE|
+				  BRASERO_MEDIUM_REWRITABLE|
+				  BRASERO_MEDIUM_APPENDABLE|
+				  BRASERO_MEDIUM_HAS_DATA,
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_MULTI|
+				  BRASERO_BURN_FLAG_DUMMY|
+				  BRASERO_BURN_FLAG_NOGRACE|
+				  BRASERO_BURN_FLAG_APPEND|
+				  BRASERO_BURN_FLAG_MERGE,
+				  BRASERO_BURN_FLAG_NONE);
+
+	/* see NOTE for DVD-RW restricted overwrite below */
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVD|
+				  BRASERO_MEDIUM_RESTRICTED|
+				  BRASERO_MEDIUM_REWRITABLE|
+				  BRASERO_MEDIUM_BLANK,
+				  BRASERO_BURN_FLAG_DAO|
+				  BRASERO_BURN_FLAG_MULTI|
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_DUMMY|
+				  BRASERO_BURN_FLAG_NOGRACE|
+				  BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE,
+				  BRASERO_BURN_FLAG_MULTI);
+
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVD|
+				  BRASERO_MEDIUM_RESTRICTED|
+				  BRASERO_MEDIUM_REWRITABLE|
+				  BRASERO_MEDIUM_APPENDABLE|
+				  BRASERO_MEDIUM_CLOSED|
+				  BRASERO_MEDIUM_HAS_DATA,
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_MULTI|
+				  BRASERO_BURN_FLAG_DUMMY|
+				  BRASERO_BURN_FLAG_NOGRACE|
+				  BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE,
+				  BRASERO_BURN_FLAG_MULTI);
+
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVD|
+				  BRASERO_MEDIUM_RESTRICTED|
+				  BRASERO_MEDIUM_REWRITABLE|
+				  BRASERO_MEDIUM_APPENDABLE|
+				  BRASERO_MEDIUM_CLOSED|
+				  BRASERO_MEDIUM_HAS_DATA,
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_MULTI|
+				  BRASERO_BURN_FLAG_DUMMY|
+				  BRASERO_BURN_FLAG_NOGRACE|
+				  BRASERO_BURN_FLAG_MERGE,
+				  BRASERO_BURN_FLAG_MULTI);
+
+	/* DVD+ R/RW don't support dummy mode 
+	 * NOTE: don't mix dao and multisession */
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVDR_PLUS|
+				  BRASERO_MEDIUM_BLANK,
+				  BRASERO_BURN_FLAG_DAO|
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_NOGRACE,
+				  BRASERO_BURN_FLAG_NONE);
+
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVDR_PLUS|
+				  BRASERO_MEDIUM_BLANK,
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_MULTI|
+				  BRASERO_BURN_FLAG_NOGRACE,
+				  BRASERO_BURN_FLAG_NONE);
+
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVDR_PLUS|
+				  BRASERO_MEDIUM_APPENDABLE|
+				  BRASERO_MEDIUM_HAS_DATA,
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_MULTI|
+				  BRASERO_BURN_FLAG_NOGRACE|
+				  BRASERO_BURN_FLAG_APPEND|
+				  BRASERO_BURN_FLAG_MERGE,
+				  BRASERO_BURN_FLAG_NONE);
+
+	/* for DVD+RW */
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVDRW_PLUS|
+				  BRASERO_MEDIUM_BLANK,
+				  BRASERO_BURN_FLAG_DAO|
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_NOGRACE,
+				  BRASERO_BURN_FLAG_NONE);
+
+	brasero_plugin_set_flags (plugin,
+				  BRASERO_MEDIUM_DVDRW_PLUS|
+				  BRASERO_MEDIUM_APPENDABLE|
+				  BRASERO_MEDIUM_CLOSED|
+				  BRASERO_MEDIUM_HAS_DATA,
+				  BRASERO_BURN_FLAG_BURNPROOF|
+				  BRASERO_BURN_FLAG_OVERBURN|
+				  BRASERO_BURN_FLAG_NOGRACE|
+				  BRASERO_BURN_FLAG_BLANK_BEFORE_WRITE,
+				  BRASERO_BURN_FLAG_NONE);
+
+	/* Flags for CD (RW)s */
 	brasero_plugin_set_flags (plugin,
 				  BRASERO_MEDIUM_CD|
 				  BRASERO_MEDIUM_WRITABLE|

Modified: trunk/src/scsi-opcodes.h
==============================================================================
--- trunk/src/scsi-opcodes.h	(original)
+++ trunk/src/scsi-opcodes.h	Thu May  8 18:45:57 2008
@@ -22,13 +22,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301,  USA
  */
 
+#include <glib.h>
+
 #ifndef _SCSI_CMD_OPCODES_H
 #define _SCSI_CMD_OPCODES_H
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
+G_BEGIN_DECLS
 
 /**
  *	SPC1
@@ -70,9 +69,7 @@
 
 #define BRASERO_READ_DISC_STRUCTURE_OPCODE		0xAD
 
-#ifdef __cplusplus
-}
-#endif
+G_END_DECLS
 
 #endif /* _SCSI_CMD-OPCODES_H */
 



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