changeset 3784:2c92b8947057

Maybe it works now.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 18 Oct 2007 18:02:10 +0300
parents 9ae0a88420e5
children 48daf98313e0
files src/audacious/playlist.c
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playlist.c	Thu Oct 18 17:07:09 2007 +0300
+++ b/src/audacious/playlist.c	Thu Oct 18 18:02:10 2007 +0300
@@ -669,7 +669,7 @@
 {
     PlaylistEntry *entry;
     Tuple *parent_tuple = NULL;
-    gint nsubtunes, subtune;
+    gint nsubtunes = 0, subtune = 0;
     gboolean add_flag = TRUE;
 
     g_return_if_fail(playlist != NULL);
@@ -677,12 +677,10 @@
 
     if (tuple != NULL) {
         nsubtunes = tuple->nsubtunes;
-        if (nsubtunes > 0)
+        if (nsubtunes > 0) {
             parent_tuple = tuple;
-        subtune = 1;
-    } else {
-        nsubtunes = 0;
-        subtune = 0;
+            subtune = 1;
+        }
     }
 
     for (; add_flag && subtune <= nsubtunes; subtune++) {
@@ -706,11 +704,11 @@
             tuple ? tuple_get_int(tuple, FIELD_LENGTH, NULL) : -1, dec);
         g_free(filename_entry);
 
+        PLAYLIST_LOCK(playlist);
+        
         if (!playlist->tail)
             playlist->tail = g_list_last(playlist->entries);
 
-        PLAYLIST_LOCK(playlist);
-
         if (pos == -1) { // the common case
             GList *element;
             element = g_list_alloc();
@@ -742,7 +740,6 @@
         PLAYLIST_UNLOCK(playlist);
     }
 
-    
     if (parent_tuple)
         tuple_free(parent_tuple);