[brasero] Merge all the formats of stream type tracks



commit cdbc770da31e879573603b97e905f6ec0a6dbf99
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Sun Sep 20 20:17:35 2009 +0200

    Merge all the formats of stream type tracks

 libbrasero-burn/brasero-session.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/libbrasero-burn/brasero-session.c b/libbrasero-burn/brasero-session.c
index c76c633..0c5988c 100644
--- a/libbrasero-burn/brasero-session.c
+++ b/libbrasero-burn/brasero-session.c
@@ -581,20 +581,29 @@ BraseroBurnResult
 brasero_burn_session_get_input_type (BraseroBurnSession *self,
 				     BraseroTrackType *type)
 {
-	BraseroTrack *track;
+	GSList *iter;
+	BraseroStreamFormat format;
 	BraseroBurnSessionPrivate *priv;
 
 	g_return_val_if_fail (BRASERO_IS_BURN_SESSION (self), BRASERO_BURN_ERR);
 
 	priv = BRASERO_BURN_SESSION_PRIVATE (self);
 
-	if (!priv->tracks)
-		return BRASERO_BURN_OK;
-
 	/* there can be many tracks (in case of audio) but they must be
-	 * all of the same kind for the moment */
-	track = priv->tracks->data;
-	brasero_track_get_track_type (track, type);
+	 * all of the same kind for the moment. Yet their subtypes may
+	 * be different. */
+	format = BRASERO_AUDIO_FORMAT_NONE;
+	for (iter = priv->tracks; iter; iter = iter->next) {
+		BraseroTrack *track;
+
+		track = iter->data;
+		brasero_track_get_track_type (track, type);
+		if (brasero_track_type_get_has_stream (type))
+			format |= brasero_track_type_get_stream_format (type);
+	}
+
+	if (brasero_track_type_get_has_stream (type))
+		brasero_track_type_set_image_format (type, format);
 
 	return BRASERO_BURN_OK;
 }



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