[vlc-devel] Trying to fix wrong playback order after items are rearranged

David Fuhrmann david.fuhrmann at googlemail.com
Mon Jul 9 20:12:31 CEST 2012

Hi Guys,

Currently, I'm trying to fix #4397. The problem is that if you rearrange playlist items in the osx gui while another item is playing, the new order is not taken into account.

Comparing the code from the mac osx and qt gui, I noticed that qt uses playlist_TreeMoveMany for drag and drop handling, while the osx gui uses playlist_NodeRemoveItem and playlist_NodeInsert.

To fix the issue for the osx gui (and probably all other modules which will use these functions), I came up with the below solution.
But I don't know the core good enough, therefore I want to ask for opinions from the core experts here. Is this patch ok? Or should this problem be solved in another way (using another function, e.g. TreeMoveMany as in the qt ui)?

Now, here is the diff:

--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -222,6 +222,9 @@ int playlist_NodeInsert( playlist_t *p_playlist,
                  p_item );
     p_item->p_parent = p_parent;
+    pl_priv( p_playlist )->b_reset_currently_playing = true;
+    vlc_cond_signal( &pl_priv( p_playlist )->signal );
     return VLC_SUCCESS;

Best regards,

More information about the vlc-devel mailing list