summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-26 21:26:39 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-07-26 21:26:39 +0000
commit06693273a4a58619706aae35cb8c87a85fadc967 (patch)
tree2cb15d38b59725e32fcd55829141129af2d36159 /mplayer.c
parenta70e4ff97360256323c0d222ae8a3c1ef57770e0 (diff)
downloadmpv-06693273a4a58619706aae35cb8c87a85fadc967.tar.bz2
mpv-06693273a4a58619706aae35cb8c87a85fadc967.tar.xz
Add loadfile and loadlist commands. May be buggy if the filename contain some
spaces. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6819 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/mplayer.c b/mplayer.c
index 5db9dae8a4..facc870833 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2393,7 +2393,31 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
case MP_CMD_MUTE: {
mixer_mute();
}
- case MP_CMD_MIXER_USEMASTER : {
+ case MP_CMD_LOADFILE : {
+ play_tree_t* e = play_tree_new();
+ play_tree_add_file(e,cmd->args[0].v.s);
+
+ // Go back to the start point
+ while(play_tree_iter_up_step(playtree_iter,0,1) != PLAY_TREE_ITER_END)
+ /* NOP */;
+ play_tree_free_list(playtree->child,1);
+ play_tree_set_child(playtree,e);
+ play_tree_iter_step(playtree_iter,0,0);
+ eof = PT_NEXT_SRC;
+ } break;
+ case MP_CMD_LOADLIST : {
+ play_tree_t* e = parse_playlist_file(cmd->args[0].v.s);
+ if(!e)
+ mp_msg(MSGT_CPLAYER,MSGL_ERR,"\nUnable to load playlist %s\n",cmd->args[0].v.s);
+ else {
+ // Go back to the start point
+ while(play_tree_iter_up_step(playtree_iter,0,1) != PLAY_TREE_ITER_END)
+ /* NOP */;
+ play_tree_free_list(playtree->child,1);
+ play_tree_set_child(playtree,e);
+ play_tree_iter_step(playtree_iter,0,0);
+ eof = PT_NEXT_SRC;
+ }
} break;
case MP_CMD_BRIGHTNESS : {
int v = cmd->args[0].v.i, abs = cmd->args[1].v.i;