[brasero] Let BraseroProcess derived plugins add a track of their own and if so don't automatically add one



commit e4b0d3a754ab95c14c633dcf57e5ed1d9cf482ea
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Wed Oct 7 20:25:36 2009 +0200

    Let BraseroProcess derived plugins add a track of their own and if so don't automatically add one

 libbrasero-burn/brasero-caps-session.c |    2 +-
 libbrasero-burn/burn-process.c         |   10 +++++++++-
 libbrasero-burn/burn-task-ctx.c        |    9 ++++++++-
 3 files changed, 18 insertions(+), 3 deletions(-)
---
diff --git a/libbrasero-burn/brasero-caps-session.c b/libbrasero-burn/brasero-caps-session.c
index 6cab60d..34ecc40 100644
--- a/libbrasero-burn/brasero-caps-session.c
+++ b/libbrasero-burn/brasero-caps-session.c
@@ -888,7 +888,7 @@ brasero_burn_caps_is_session_supported_same_src_dest (BraseroBurnCaps *self,
 			if (result) {
 				if (tmp_type) {
 					tmp_type->type = BRASERO_TRACK_TYPE_IMAGE;
-					tmp_type->subtype.img_format = format;
+					tmp_type->subtype.img_format = brasero_track_type_get_image_format (&output);
 				}
 					
 				return BRASERO_BURN_OK;
diff --git a/libbrasero-burn/burn-process.c b/libbrasero-burn/burn-process.c
index bee6042..5b6c169 100644
--- a/libbrasero-burn/burn-process.c
+++ b/libbrasero-burn/burn-process.c
@@ -253,6 +253,15 @@ brasero_process_finished (BraseroProcess *self)
 		return BRASERO_BURN_OK;
 	}
 
+	klass->post (BRASERO_JOB (self));
+
+	/* See if the plugin already added some new tracks
+	 * if so don't add it automatically */
+	if (brasero_job_get_done_tracks (BRASERO_JOB (self), NULL) == BRASERO_BURN_OK) {
+		brasero_track_type_free (type);
+		return BRASERO_BURN_OK;
+	}
+
 	if (brasero_track_type_get_has_image (type)) {
 		gchar *toc = NULL;
 		gchar *image = NULL;
@@ -295,7 +304,6 @@ brasero_process_finished (BraseroProcess *self)
 		g_object_unref (track);
 	}
 
-	klass->post (BRASERO_JOB (self));
 	return BRASERO_BURN_OK;
 }
 
diff --git a/libbrasero-burn/burn-task-ctx.c b/libbrasero-burn/burn-task-ctx.c
index 6680d75..b7082d9 100644
--- a/libbrasero-burn/burn-task-ctx.c
+++ b/libbrasero-burn/burn-task-ctx.c
@@ -233,7 +233,14 @@ brasero_task_ctx_get_stored_tracks (BraseroTaskCtx *self,
 	if (!priv->current_track)
 		return BRASERO_BURN_ERR;
 
-	*tracks = priv->tracks;
+	if (tracks)
+		*tracks = priv->tracks;
+
+	/* If no track has been added let the caller
+	 * know with BRASERO_BURN_NOT_READY */
+	if (!priv->tracks)
+		return BRASERO_BURN_NOT_READY;
+
 	return BRASERO_BURN_OK;
 }
 



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