]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - playlist.c
playlist.c: Remove an unused variable.
[paraslash.git] / playlist.c
index 1c496cae506a0289e805b1a98729b16399ab5065..c6f09bef78bb6e0712a81dea8b4e373788298aca 100644 (file)
@@ -144,6 +144,8 @@ int playlist_check_callback(__a_unused const struct osl_object *query,
  */
 void playlist_close(void)
 {
+       if (!current_playlist.name)
+               return;
        free(current_playlist.name);
        current_playlist.name = NULL;
 }
@@ -171,8 +173,9 @@ int playlist_open(char *name)
                PARA_NOTICE_LOG("failed to load playlist %s\n", name);
                return ret;
        }
+       playlist_close();
        ret = load_playlist(row, &current_playlist);
-       return (ret == -E_PLAYLIST_LOADED)? 1 : ret;
+       return (ret == -E_PLAYLIST_LOADED)? current_playlist.length : ret;
 }
 
 static int search_path(char *path, void *data)