From bf402578ab5bd9bc35bb5539d381d5612d19d40b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 2 Oct 2008 03:24:21 -0700 Subject: Revert "Start using song pointers in core data structures" This actually opened us up to making lock dependencies more difficult than they needed to be now that we have threaded updates. We would always use the memory anyways, just in the stack instead of bss. --- src/playlist.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/playlist.c') diff --git a/src/playlist.c b/src/playlist.c index ca903036d..2ab09ebff 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -554,11 +554,15 @@ void playlist_queue_next(void) wakeup_main_task(); } -Song *playlist_queued_song(void) +char *playlist_queued_url(char utf8url[MPD_PATH_MAX]) { + Song *song; + assert(pthread_equal(pthread_self(), dc.thread)); pthread_mutex_lock(&queue_lock); - return song_at(playlist.queued); + song = song_at(playlist.queued); + + return song ? get_song_url(utf8url, song) : NULL; } static void queue_song_locked(int order_num) -- cgit v1.2.3