diff options
Diffstat (limited to 'core/mplayer.c')
-rw-r--r-- | core/mplayer.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/mplayer.c b/core/mplayer.c index 4377f9f9bc..f12560b589 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -4521,6 +4521,16 @@ static void play_files(struct MPContext *mpctx) } } +// Abort current playback and set the given entry to play next. +// e must be on the mpctx->playlist. +void mp_set_playlist_entry(struct MPContext *mpctx, struct playlist_entry *e) +{ + assert(playlist_entry_to_index(mpctx->playlist, e) >= 0); + mpctx->playlist->current = e; + mpctx->playlist->current_was_replaced = false; + mpctx->stop_play = PT_CURRENT_ENTRY; +} + void mp_print_version(int always) { mp_msg(MSGT_CPLAYER, always ? MSGL_INFO : MSGL_V, |