brasero r1989 - in trunk: . src src/plugins/transcode



Author: philippr
Date: Sun Feb 22 10:05:29 2009
New Revision: 1989
URL: http://svn.gnome.org/viewvc/brasero?rev=1989&view=rev

Log:
2009-02-22  Philippe Rouquier  <bonfire-app wanadoo fr>

	Fix a crash introduced by late cleanups

	* src/brasero-dest-selection.c
	(brasero_dest_selection_format_medium_string):

Modified:
   trunk/ChangeLog
   trunk/src/brasero-dest-selection.c
   trunk/src/plugins/transcode/burn-normalize.c

Modified: trunk/src/brasero-dest-selection.c
==============================================================================
--- trunk/src/brasero-dest-selection.c	(original)
+++ trunk/src/brasero-dest-selection.c	Sun Feb 22 10:05:29 2009
@@ -479,9 +479,9 @@
 	if (input.type == BRASERO_TRACK_TYPE_AUDIO
 	|| (input.type == BRASERO_TRACK_TYPE_DISC
 	&& (input.subtype.media & BRASERO_MEDIUM_HAS_AUDIO)))
-		brasero_units_get_time_string (BRASERO_BYTES_TO_DURATION (size_bytes),
-					       TRUE,
-					       TRUE);
+		size_string = brasero_units_get_time_string (BRASERO_BYTES_TO_DURATION (size_bytes),
+							     TRUE,
+							     TRUE);
 	else
 		size_string = g_format_size_for_display (size_bytes);
 

Modified: trunk/src/plugins/transcode/burn-normalize.c
==============================================================================
--- trunk/src/plugins/transcode/burn-normalize.c	(original)
+++ trunk/src/plugins/transcode/burn-normalize.c	Sun Feb 22 10:05:29 2009
@@ -47,6 +47,7 @@
 	GstElement *pipeline;
 	GstElement *analysis;
 	GstElement *decode;
+	GstElement *resample;
 	GstElement *source;
 
 	GSList *tracks;
@@ -91,6 +92,7 @@
 	uri = brasero_track_get_audio_source (track, TRUE);
 	source = gst_element_make_from_uri (GST_URI_SRC, uri, NULL);
 	if (source == NULL) {
+		g_free (uri);
 		g_set_error (error,
 			     BRASERO_BURN_ERROR,
 			     BRASERO_BURN_ERROR_GENERAL,
@@ -104,7 +106,10 @@
 		      NULL);
 
 	priv->source = source;
-	gst_element_link_many (source, priv->decode, NULL);
+	if (!gst_element_link_many (source, priv->decode, NULL)) {
+		BRASERO_JOB_LOG (job, "Elements could not be linked");
+		return FALSE;
+	}
 
 	/* reconnect to the bus */	
 	bus = gst_pipeline_get_bus (GST_PIPELINE (priv->pipeline));
@@ -115,6 +120,9 @@
 
 	priv->track = track;
 
+	BRASERO_JOB_LOG (job, "Analysing track %s", uri);
+	g_free (uri);
+
 	return TRUE;
 }
 
@@ -130,6 +138,7 @@
 	gst_element_set_state (priv->pipeline, GST_STATE_NULL);
 	gst_object_unref (GST_OBJECT (priv->pipeline));
 	priv->pipeline = NULL;
+	priv->resample = NULL;
 	priv->analysis = NULL;
 	priv->decode = NULL;
 	priv->source = NULL;
@@ -242,6 +251,9 @@
 	}
 
 	/* jump to next track */
+	/* NOTE: why lock state? because otherwise analysis would lose all 
+	 * information about tracks already analysed by going into the NULL
+	 * state. */
 	gst_element_set_locked_state (priv->analysis, TRUE);
 	gst_element_set_state (priv->pipeline, GST_STATE_NULL);
 
@@ -303,15 +315,20 @@
 brasero_normalize_new_decoded_pad_cb (GstElement *decode,
 				      GstPad *pad,
 				      gboolean arg2,
-				      GstElement *convert)
+				      BraseroNormalize *normalize)
 {
 	GstPad *sink;
 	GstCaps *caps;
 	GstStructure *structure;
+	BraseroNormalizePrivate *priv;
+
+	priv = BRASERO_NORMALIZE_PRIVATE (normalize);
 
-	sink = gst_element_get_pad (convert, "sink");
-	if (GST_PAD_IS_LINKED (sink))
+	sink = gst_element_get_pad (priv->resample, "sink");
+	if (GST_PAD_IS_LINKED (sink)) {
+		BRASERO_JOB_LOG (normalize, "New decoded pad already linked");
 		return;
+	}
 
 	/* make sure we only have audio */
 	caps = gst_pad_get_caps (pad);
@@ -319,9 +336,17 @@
 		return;
 
 	structure = gst_caps_get_structure (caps, 0);
-	if (structure && g_strrstr (gst_structure_get_name (structure), "audio"))
-		gst_pad_link (pad, sink);
-
+	if (structure && g_strrstr (gst_structure_get_name (structure), "audio")) {
+		if (gst_pad_link (pad, sink) != GST_PAD_LINK_OK) {
+			BRASERO_JOB_LOG (normalize, "New decoded pad can't be linked");
+			brasero_job_error (BRASERO_JOB (normalize), NULL);
+		}
+		else
+			BRASERO_JOB_LOG (normalize, "New decoded pad linked");
+	}
+	else
+		BRASERO_JOB_LOG (normalize, "New decoded pad with unsupported stream time");
+		
 	gst_object_unref (sink);
 	gst_caps_unref (caps);
 }
@@ -384,6 +409,7 @@
 		goto error;
 	}
 	gst_bin_add (GST_BIN (pipeline), resample);
+	priv->resample = resample;
 
 	/* rganalysis: set the number of tracks to be expected */
 	analysis = gst_element_factory_make ("rganalysis", NULL);
@@ -417,7 +443,7 @@
 	g_signal_connect (G_OBJECT (decode),
 			  "new-decoded-pad",
 			  G_CALLBACK (brasero_normalize_new_decoded_pad_cb),
-			  resample);
+			  normalize);
 	gst_element_link_many (resample,
 			       convert,
 			       analysis,



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