summaryrefslogtreecommitdiffstats
path: root/core/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-28 22:16:29 +0200
committerwm4 <wm4@nowhere>2013-06-29 22:58:12 +0200
commita6a1f4b8336c0d18c0588922da6b786b6408209f (patch)
tree1fd7bae3a83c98a090601c824ff35a933603c3ef /core/mplayer.c
parentfd7dd83e287c96f8be026cdec2c1ec74aaaa823b (diff)
downloadmpv-a6a1f4b8336c0d18c0588922da6b786b6408209f.tar.bz2
mpv-a6a1f4b8336c0d18c0588922da6b786b6408209f.tar.xz
command: add properties for playlist position
playlist-pos can set/get the current playlist index. playlist-count returns the number of entries in the playlist.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r--core/mplayer.c10
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,