]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - playlist.c
Doxygen fixes.
[paraslash.git] / playlist.c
index 1c496cae506a0289e805b1a98729b16399ab5065..62fd831acfa1bff04097b59dad33b3b22cee41f6 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)
@@ -220,8 +223,8 @@ static int handle_audio_file_event(enum afs_events event, void *data)
        return score_add(row, 0); /* play it immediately */
 }
 
-int playlists_event_handler(enum afs_events event, struct para_buffer *pb,
-               void *data)
+int playlists_event_handler(enum afs_events event,
+       __a_unused struct para_buffer *pb, void *data)
 {
        int ret;