[brasero] Prevent adding the same track to a session several times.



commit c86008eb205cfb421317303b7a4055fd563ae419
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Tue Aug 4 11:16:35 2009 +0200

    Prevent adding the same track to a session several times.

 libbrasero-burn/brasero-session.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libbrasero-burn/brasero-session.c b/libbrasero-burn/brasero-session.c
index d000566..93407e5 100644
--- a/libbrasero-burn/brasero-session.c
+++ b/libbrasero-burn/brasero-session.c
@@ -242,6 +242,12 @@ brasero_burn_session_add_track (BraseroBurnSession *self,
 
 	priv = BRASERO_BURN_SESSION_PRIVATE (self);
 
+	/* Prevent adding the same tracks several times */
+	if (g_slist_find (priv->tracks, new_track)) {
+		BRASERO_BURN_LOG ("Tried to add the same track multiple times");
+		return BRASERO_BURN_OK;
+	}
+
 	if (!new_track) {
 		if (!priv->tracks)
 			return BRASERO_BURN_OK;



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