diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/playlist.c | 2 | ||||
-rw-r--r-- | common/playlist.h | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/common/playlist.c b/common/playlist.c index 89c644dc33..d7c752ad8d 100644 --- a/common/playlist.c +++ b/common/playlist.c @@ -66,6 +66,7 @@ void playlist_add(struct playlist *pl, struct playlist_entry *add) MP_TARRAY_APPEND(pl, pl->entries, pl->num_entries, add); add->pl = pl; add->pl_index = pl->num_entries - 1; + add->id = ++pl->id_alloc; talloc_steal(pl, add); } @@ -250,6 +251,7 @@ static void playlist_transfer_entries_to(struct playlist *pl, int dst_index, struct playlist_entry *e = source_pl->entries[n]; e->pl = pl; e->pl_index = dst_index + n; + e->id = ++pl->id_alloc; pl->entries[e->pl_index] = e; talloc_steal(pl, e); } diff --git a/common/playlist.h b/common/playlist.h index 8b014e864d..f8dfbb2ba2 100644 --- a/common/playlist.h +++ b/common/playlist.h @@ -30,6 +30,8 @@ struct playlist_entry { struct playlist *pl; int pl_index; + uint64_t id; + char *filename; struct playlist_param *params; @@ -71,6 +73,8 @@ struct playlist { // current_was_replaced is set to true. struct playlist_entry *current; bool current_was_replaced; + + uint64_t id_alloc; }; void playlist_entry_add_param(struct playlist_entry *e, bstr name, bstr value); |