Skip to content

Commit 19215ef

Browse files
na-na-hikasper93
authored andcommitted
player/loadfile: inherit file-local options when resolving playlist file
Currently, if a playlist file is played and replaced by its contents, the per-file options of the playlist file are ignored. This commit makes these options inherited for its contents so they work as expected.
1 parent 97db44f commit 19215ef

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

player/loadfile.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,17 +1133,21 @@ void prepare_playlist(struct MPContext *mpctx, struct playlist *pl, bool overwri
11331133

11341134
// Replace the current playlist entry with playlist contents. Moves the entries
11351135
// from the given playlist pl, so the entries don't actually need to be copied.
1136+
// The new entries inherit the file-local options of the current entry.
11361137
static void transfer_playlist(struct MPContext *mpctx, struct playlist *pl,
11371138
int64_t *start_id, int *num_new_entries)
11381139
{
11391140
if (pl->num_entries) {
11401141
prepare_playlist(mpctx, pl, true);
11411142
struct playlist_entry *new = pl->current;
1143+
struct playlist_entry *current = mpctx->playlist->current;
11421144
*num_new_entries = pl->num_entries;
1145+
if (current)
1146+
playlist_set_params(pl, current->params, current->num_params);
11431147
*start_id = playlist_transfer_entries(mpctx->playlist, pl);
11441148
// current entry is replaced
1145-
if (mpctx->playlist->current)
1146-
playlist_remove(mpctx->playlist, mpctx->playlist->current);
1149+
if (current)
1150+
playlist_remove(mpctx->playlist, current);
11471151
if (new)
11481152
mpctx->playlist->current = new;
11491153
mpctx->playlist->playlist_dir = talloc_steal(mpctx->playlist, pl->playlist_dir);

0 commit comments

Comments
 (0)