mirror of
https://github.com/mpv-player/mpv
synced 2024-12-22 23:02:37 +00:00
playlist: fix playlist_move on itself
A playlist_move command that moves an entry onto itself (both arguments have the same index) should do nothing, but it did something broken. The underlying reason is that it checks the prev pointer of the entry which is temporarily removed for moving.
This commit is contained in:
parent
ba1447822c
commit
9d0e5f6da6
@ -119,10 +119,13 @@ void playlist_clear(struct playlist *pl)
|
||||
pl->current_was_replaced = false;
|
||||
}
|
||||
|
||||
// Moves entry such that entry->prev = at (even if at is NULL)
|
||||
// Moves the entry so that it takes "at"'s place (or move to end, if at==NULL).
|
||||
void playlist_move(struct playlist *pl, struct playlist_entry *entry,
|
||||
struct playlist_entry *at)
|
||||
{
|
||||
if (entry == at)
|
||||
return;
|
||||
|
||||
struct playlist_entry *save_current = pl->current;
|
||||
bool save_replaced = pl->current_was_replaced;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user