diff options
author | waker <wakeroid@gmail.com> | 2012-10-07 14:24:55 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-10-07 14:24:55 +0200 |
commit | 857b5d6aa589203770ff42e049288e982d8664a9 (patch) | |
tree | 5656bd0074038a816cb8648feab54ac5325c4c3d | |
parent | dba664d4f00955b12a6cbdc2cc2aba86ead231fd (diff) |
fixed updating streamer playlist after moving current playing track to another playlist
-rw-r--r-- | playlist.c | 11 | ||||
-rw-r--r-- | streamer.c | 11 | ||||
-rw-r--r-- | streamer.h | 3 |
3 files changed, 25 insertions, 0 deletions
@@ -3473,9 +3473,14 @@ plt_move_items (playlist_t *to, int iter, playlist_t *from, playItem_t *drop_bef drop_after = to->tail[iter]; } + playItem_t *playing = streamer_get_playing_track (); + for (playItem_t *it = from->head[iter]; it && processed < count; it = next, idx++) { next = it->next[iter]; if (idx == indexes[processed]) { + if (it == playing && to != from) { + streamer_set_streamer_playlist (to); + } pl_item_ref (it); if (drop_after == it) { drop_after = it->prev[PL_MAIN]; @@ -3487,6 +3492,12 @@ plt_move_items (playlist_t *to, int iter, playlist_t *from, playItem_t *drop_bef processed++; } } + + if (playing) { + pl_item_unref (playing); + } + + no_remove_notify = 0; UNLOCK; } @@ -2299,3 +2299,14 @@ streamer_notify_order_changed (int prev_order, int new_order) { streamer_unlock (); } } + +void +streamer_set_streamer_playlist (playlist_t *plt) { + if (streamer_playlist) { + plt_unref (streamer_playlist); + } + streamer_playlist = plt; + if (streamer_playlist) { + plt_ref (streamer_playlist); + } +} @@ -130,4 +130,7 @@ streamer_dsp_chain_save (void); void streamer_notify_order_changed (int prev_order, int new_order); +void +streamer_set_streamer_playlist (playlist_t *plt); + #endif // __STREAMER_H |