[brasero] Fix problem of endianness in the stream while encoding after normalization (introduced by late chang



commit fddae434bc257afd67b4c1d7e332cdd423ad9ef5
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Wed Nov 25 11:06:14 2009 +0100

    Fix problem of endianness in the stream while encoding after normalization (introduced by late changes)
    Also don't crash when we can't link Gstreamer plugins right from the start

 plugins/transcode/burn-normalize.c |    4 +-
 plugins/transcode/burn-transcode.c |   43 +++++++++++++++++++----------------
 2 files changed, 25 insertions(+), 22 deletions(-)
---
diff --git a/plugins/transcode/burn-normalize.c b/plugins/transcode/burn-normalize.c
index bc20044..ff48795 100644
--- a/plugins/transcode/burn-normalize.c
+++ b/plugins/transcode/burn-normalize.c
@@ -288,11 +288,11 @@ brasero_normalize_set_next_track (BraseroJob *job,
 {
 	gchar *uri;
 	GValue *value;
-	BraseroTrack *track;
 	GstElement *analysis;
 	BraseroTrackType *type;
-	BraseroNormalizePrivate *priv;
+	BraseroTrack *track = NULL;
 	gboolean dts_allowed = FALSE;
+	BraseroNormalizePrivate *priv;
 
 	priv = BRASERO_NORMALIZE_PRIVATE (job);
 
diff --git a/plugins/transcode/burn-transcode.c b/plugins/transcode/burn-transcode.c
index 98eea7a..d3ede36 100644
--- a/plugins/transcode/burn-transcode.c
+++ b/plugins/transcode/burn-transcode.c
@@ -544,13 +544,6 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 		}
 		gst_bin_add (GST_BIN (pipeline), wavparse);
 
-		priv->link = NULL;
-		priv->sink = sink;
-		priv->decode = NULL;
-		priv->source = source;
-		priv->convert = NULL;
-		priv->pipeline = pipeline;
-
 		if (!gst_element_link (source, wavparse)) {
 			g_set_error (error,
 				     BRASERO_BURN_ERROR,
@@ -568,13 +561,21 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 		 * gstreamer. Yet this is unfortunately a necessary evil. */
 		priv->pos = 0;
 		priv->size = 0;
-		sinkpad = gst_element_get_pad (priv->sink, "sink");
+		sinkpad = gst_element_get_pad (sink, "sink");
 		priv->probe = gst_pad_add_buffer_probe (sinkpad,
 							G_CALLBACK (brasero_transcode_buffer_handler),
 							transcode);
 		gst_object_unref (sinkpad);
 
-		gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
+
+		priv->link = NULL;
+		priv->sink = sink;
+		priv->decode = NULL;
+		priv->source = source;
+		priv->convert = NULL;
+		priv->pipeline = pipeline;
+
+		gst_element_set_state (pipeline, GST_STATE_PLAYING);
 		return TRUE;
 	}
 
@@ -648,17 +649,12 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 	}
 	gst_bin_add (GST_BIN (pipeline), decode);
 
-	priv->sink = sink;
-	priv->decode = decode;
-	priv->source = source;
-	priv->convert = convert;
-	priv->pipeline = pipeline;
-
 	if (action == BRASERO_JOB_ACTION_IMAGE) {
 		GstPad *sinkpad;
 		gboolean res;
 
-		if (!gst_element_link_many (source, decode, NULL)) {
+		if (!gst_element_link (source, decode)) {
+			BRASERO_JOB_LOG (transcode, "Impossible to link plugin pads");
 			g_set_error (error,
 				     BRASERO_BURN_ERROR,
 				     BRASERO_BURN_ERROR_GENERAL,
@@ -675,12 +671,11 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 		if (volume) {
 			gst_bin_add (GST_BIN (pipeline), volume);
 			res = gst_element_link_many (resample,
-			                             convert,
 			                             volume,
+						     convert,
 			                             filter,
 			                             sink,
 			                             NULL);
-
 		}
 		else
 			res = gst_element_link_many (resample,
@@ -690,6 +685,7 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 			                             NULL);
 
 		if (!res) {
+			BRASERO_JOB_LOG (transcode, "Impossible to link plugin pads");
 			g_set_error (error,
 				     BRASERO_BURN_ERROR,
 				     BRASERO_BURN_ERROR_GENERAL,
@@ -701,7 +697,7 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 		 * gstreamer. Yet this is unfortunately a necessary evil. */
 		priv->pos = 0;
 		priv->size = 0;
-		sinkpad = gst_element_get_pad (priv->sink, "sink");
+		sinkpad = gst_element_get_pad (sink, "sink");
 		priv->probe = gst_pad_add_buffer_probe (sinkpad,
 							G_CALLBACK (brasero_transcode_buffer_handler),
 							transcode);
@@ -710,6 +706,7 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 	else {
 		if (!gst_element_link (source, decode)
 		||  !gst_element_link (convert, sink)) {
+			BRASERO_JOB_LOG (transcode, "Impossible to link plugin pads");
 			g_set_error (error,
 				     BRASERO_BURN_ERROR,
 				     BRASERO_BURN_ERROR_GENERAL,
@@ -724,7 +721,13 @@ brasero_transcode_create_pipeline (BraseroTranscode *transcode,
 				  transcode);
 	}
 
-	gst_element_set_state (priv->pipeline, GST_STATE_PLAYING);
+	priv->sink = sink;
+	priv->decode = decode;
+	priv->source = source;
+	priv->convert = convert;
+	priv->pipeline = pipeline;
+
+	gst_element_set_state (pipeline, GST_STATE_PLAYING);
 	return TRUE;
 
 error:



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