[brasero] Change the default behaviour for transcode and output big endian PCM now



commit daadebb0fdba02c7903207857f89c3328c413437
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Sun Nov 22 19:17:49 2009 +0100

    Change the default behaviour for transcode and output big endian PCM now
    Added a new BraseroStreamFormat value for libburn which needs little endian

 libbrasero-burn/brasero-enums.h        |    2 +
 libbrasero-burn/burn-debug.c           |    3 ++
 plugins/audio2cue/burn-audio2cue.c     |    4 +-
 plugins/cdrkit/burn-wodim.c            |    2 -
 plugins/cdrtools/burn-cdrecord.c       |    2 -
 plugins/libburnia/burn-libburn.c       |    2 +-
 plugins/local-track/burn-local-image.c |    2 +
 plugins/transcode/burn-transcode.c     |   36 +++++++++++++++++++++----------
 8 files changed, 34 insertions(+), 19 deletions(-)
---
diff --git a/libbrasero-burn/brasero-enums.h b/libbrasero-burn/brasero-enums.h
index f5f7cb1..4550c34 100644
--- a/libbrasero-burn/brasero-enums.h
+++ b/libbrasero-burn/brasero-enums.h
@@ -141,6 +141,8 @@ typedef enum {
 
 	BRASERO_METADATA_INFO			= 1 << 10,
 
+	BRASERO_AUDIO_FORMAT_RAW_LITTLE_ENDIAN  = 1 << 11,
+
 	/* Deprecated */
 	BRASERO_AUDIO_FORMAT_4_CHANNEL		= 0
 } BraseroStreamFormat;
diff --git a/libbrasero-burn/burn-debug.c b/libbrasero-burn/burn-debug.c
index fea0eff..e84d2be 100644
--- a/libbrasero-burn/burn-debug.c
+++ b/libbrasero-burn/burn-debug.c
@@ -234,6 +234,9 @@ brasero_debug_audio_format_to_string (gchar *buffer,
 	if (format & BRASERO_AUDIO_FORMAT_RAW)
 		strcat (buffer, "RAW ");
 
+	if (format & BRASERO_AUDIO_FORMAT_RAW_LITTLE_ENDIAN)
+		strcat (buffer, "RAW (little endian)");
+
 	if (format & BRASERO_AUDIO_FORMAT_UNDEFINED)
 		strcat (buffer, "AUDIO UNDEFINED ");
 
diff --git a/plugins/audio2cue/burn-audio2cue.c b/plugins/audio2cue/burn-audio2cue.c
index 54f585f..b8cfaff 100644
--- a/plugins/audio2cue/burn-audio2cue.c
+++ b/plugins/audio2cue/burn-audio2cue.c
@@ -417,8 +417,8 @@ brasero_audio2cue_create_thread (gpointer data)
 		goto end;
 	}
 
-	/** Least significant byte first (MOTOROLA otherwise) **/
-	line = g_strdup_printf ("FILE \"%s\" BINARY\n", image);
+	/** Most significant byte first (BINARY otherwise as far as I can tell) **/
+	line = g_strdup_printf ("FILE \"%s\" MOTOROLA\n", image);
 	if (write (fd_out, line, strlen (line)) < 0) {
 		int err_saved = errno;
 		priv->error = g_error_new_literal (BRASERO_BURN_ERROR,
diff --git a/plugins/cdrkit/burn-wodim.c b/plugins/cdrkit/burn-wodim.c
index 0e6c1ff..26ab8ee 100644
--- a/plugins/cdrkit/burn-wodim.c
+++ b/plugins/cdrkit/burn-wodim.c
@@ -864,7 +864,6 @@ brasero_wodim_set_argv_record (BraseroWodim *wodim,
 			/* NOTE: when we don't want wodim to use stdin then we
 			 * give the audio file on the command line. Otherwise we
 			 * use the .inf */
-			g_ptr_array_add (argv, g_strdup ("-swab"));
 			g_ptr_array_add (argv, g_strdup ("-audio"));
 			g_ptr_array_add (argv, g_strdup ("-useinfo"));
 			g_ptr_array_add (argv, g_strdup ("-text"));
@@ -888,7 +887,6 @@ brasero_wodim_set_argv_record (BraseroWodim *wodim,
 
 		g_ptr_array_add (argv, g_strdup ("fs=16m"));
 		g_ptr_array_add (argv, g_strdup ("-audio"));
-		g_ptr_array_add (argv, g_strdup ("-swab"));
 		g_ptr_array_add (argv, g_strdup ("-pad"));
 	
 		g_ptr_array_add (argv, g_strdup ("-useinfo"));
diff --git a/plugins/cdrtools/burn-cdrecord.c b/plugins/cdrtools/burn-cdrecord.c
index f18e4e2..8687622 100644
--- a/plugins/cdrtools/burn-cdrecord.c
+++ b/plugins/cdrtools/burn-cdrecord.c
@@ -860,7 +860,6 @@ brasero_cdrecord_set_argv_record (BraseroCDRecord *cdrecord,
 			}
 		}
 		else if (brasero_track_type_get_has_stream (type)) {
-			g_ptr_array_add (argv, g_strdup ("-swab"));
 			g_ptr_array_add (argv, g_strdup ("-audio"));
 			g_ptr_array_add (argv, g_strdup ("-useinfo"));
 			g_ptr_array_add (argv, g_strdup ("-text"));
@@ -884,7 +883,6 @@ brasero_cdrecord_set_argv_record (BraseroCDRecord *cdrecord,
 
 		g_ptr_array_add (argv, g_strdup ("fs=16m"));
 		g_ptr_array_add (argv, g_strdup ("-audio"));
-		g_ptr_array_add (argv, g_strdup ("-swab"));
 		g_ptr_array_add (argv, g_strdup ("-pad"));
 	
 		g_ptr_array_add (argv, g_strdup ("-useinfo"));
diff --git a/plugins/libburnia/burn-libburn.c b/plugins/libburnia/burn-libburn.c
index 80d9cbc..98c66d9 100644
--- a/plugins/libburnia/burn-libburn.c
+++ b/plugins/libburnia/burn-libburn.c
@@ -995,7 +995,7 @@ brasero_libburn_export_caps (BraseroPlugin *plugin)
 	/* audio support for CDs only */
 	input = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_PIPE|
 					BRASERO_PLUGIN_IO_ACCEPT_FILE,
-					BRASERO_AUDIO_FORMAT_RAW);
+					BRASERO_AUDIO_FORMAT_RAW_LITTLE_ENDIAN);
 	
 	output = brasero_caps_disc_new (media_cd);
 	brasero_plugin_link_caps (plugin, output, input);
diff --git a/plugins/local-track/burn-local-image.c b/plugins/local-track/burn-local-image.c
index 1aa8104..dbcd9c5 100644
--- a/plugins/local-track/burn-local-image.c
+++ b/plugins/local-track/burn-local-image.c
@@ -921,6 +921,7 @@ brasero_local_track_export_caps (BraseroPlugin *plugin)
 				       BRASERO_AUDIO_FORMAT_UNDEFINED|
 	                               BRASERO_AUDIO_FORMAT_DTS|
 				       BRASERO_AUDIO_FORMAT_RAW|
+				       BRASERO_AUDIO_FORMAT_RAW_LITTLE_ENDIAN|
 				       BRASERO_VIDEO_FORMAT_UNDEFINED|
 				       BRASERO_VIDEO_FORMAT_VCD|
 				       BRASERO_VIDEO_FORMAT_VIDEO_DVD|
@@ -934,6 +935,7 @@ brasero_local_track_export_caps (BraseroPlugin *plugin)
 				       BRASERO_AUDIO_FORMAT_UNDEFINED|
 	                               BRASERO_AUDIO_FORMAT_DTS|
 				       BRASERO_AUDIO_FORMAT_RAW|
+				       BRASERO_AUDIO_FORMAT_RAW_LITTLE_ENDIAN|
 				       BRASERO_VIDEO_FORMAT_UNDEFINED|
 				       BRASERO_VIDEO_FORMAT_VCD|
 				       BRASERO_VIDEO_FORMAT_VIDEO_DVD|
diff --git a/plugins/transcode/burn-transcode.c b/plugins/transcode/burn-transcode.c
index ee04afb..98eea7a 100644
--- a/plugins/transcode/burn-transcode.c
+++ b/plugins/transcode/burn-transcode.c
@@ -394,11 +394,12 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 				   GError **error)
 {
 	gchar *uri;
-	GValue *value = NULL;
+	gboolean keep_dts;
 	GstElement *decode;
 	GstElement *source;
 	GstBus *bus = NULL;
 	GstCaps *filtercaps;
+	GValue *value = NULL;
 	GstElement *pipeline;
 	GstElement *sink = NULL;
 	BraseroJobAction action;
@@ -408,7 +409,6 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 	BraseroTrack *track = NULL;
 	GstElement *resample = NULL;
 	BraseroTranscodePrivate *priv;
-	BraseroStreamFormat session_format;
 
 	priv = BRASERO_TRANSCODE_PRIVATE (transcode);
 
@@ -514,13 +514,16 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 		      "sync", FALSE,
 		      NULL);
 
-	session_format = BRASERO_AUDIO_FORMAT_RAW;
-	brasero_job_tag_lookup (BRASERO_JOB (transcode), BRASERO_SESSION_STREAM_AUDIO_FORMAT, &value);
+	brasero_job_tag_lookup (BRASERO_JOB (transcode),
+				BRASERO_SESSION_STREAM_AUDIO_FORMAT,
+				&value);
 	if (value)
-		session_format = g_value_get_int (value);
-	
-	if (action == BRASERO_JOB_ACTION_IMAGE
-	&& (session_format & BRASERO_AUDIO_FORMAT_DTS) != 0
+		keep_dts = (g_value_get_int (value) & BRASERO_AUDIO_FORMAT_DTS) != 0;
+	else
+		keep_dts = FALSE;
+
+	if (keep_dts
+	&&  action == BRASERO_JOB_ACTION_IMAGE
 	&& (brasero_track_stream_get_format (BRASERO_TRACK_STREAM (track)) & BRASERO_AUDIO_FORMAT_DTS) != 0) {
 		GstElement *wavparse;
 		GstPad *sinkpad;
@@ -588,6 +591,14 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 	gst_bin_add (GST_BIN (pipeline), convert);
 
 	if (action == BRASERO_JOB_ACTION_IMAGE) {
+		BraseroStreamFormat session_format;
+		BraseroTrackType *output_type;
+
+		output_type = brasero_track_type_new ();
+		brasero_job_get_output_type (BRASERO_JOB (transcode), output_type);
+		session_format = brasero_track_type_get_stream_format (output_type);
+		brasero_track_type_free (output_type);
+
 		/* audioresample */
 		resample = gst_element_factory_make ("audioresample", NULL);
 		if (resample == NULL) {
@@ -615,9 +626,8 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 								   "channels", G_TYPE_INT, 2,
 								   "width", G_TYPE_INT, 16,
 								   "depth", G_TYPE_INT, 16,
-								   /* NOTE: we use little endianness only
-								    * for libburn which requires little */
-								   "endianness", G_TYPE_INT, 1234,
+								   /* NOTE: we use little endianness only for libburn which requires little */
+								   "endianness", G_TYPE_INT, (session_format & BRASERO_AUDIO_FORMAT_RAW_LITTLE_ENDIAN) != 0 ? 1234:4321,
 								   "rate", G_TYPE_INT, 44100,
 								   "signed", G_TYPE_BOOLEAN, TRUE,
 								   NULL),
@@ -1759,6 +1769,7 @@ brasero_transcode_export_caps (BraseroPlugin *plugin)
 	output = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE|
 					 BRASERO_PLUGIN_IO_ACCEPT_PIPE,
 					 BRASERO_AUDIO_FORMAT_RAW|
+					 BRASERO_AUDIO_FORMAT_RAW_LITTLE_ENDIAN|
 					 BRASERO_METADATA_INFO);
 
 	input = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
@@ -1777,7 +1788,8 @@ brasero_transcode_export_caps (BraseroPlugin *plugin)
 
 	output = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE|
 					 BRASERO_PLUGIN_IO_ACCEPT_PIPE,
-					 BRASERO_AUDIO_FORMAT_RAW);
+					 BRASERO_AUDIO_FORMAT_RAW|
+					 BRASERO_AUDIO_FORMAT_RAW_LITTLE_ENDIAN);
 
 	input = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
 					BRASERO_AUDIO_FORMAT_UNDEFINED);



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