diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2008-10-02 05:17:23 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2008-10-02 05:17:23 +0300 |
commit | ebb4abf2081026c63bb5c983f76447d9d2413656 (patch) | |
tree | f2b3ed868645fd2546173be3500f4c3e0cdf3ecc /command.c | |
parent | 849dc0ba31f209dfdb48146512e48ee2203d0ee6 (diff) | |
parent | 20571d6f6870dab84624cc6b6fbac82cde204f16 (diff) | |
download | mpv-ebb4abf2081026c63bb5c983f76447d9d2413656.tar.bz2 mpv-ebb4abf2081026c63bb5c983f76447d9d2413656.tar.xz |
Merge svn changes up to r27682
Addition of the "outdir" suboption to vo_png in svn was reverted
before merging.
Conflicts:
command.c
mplayer.c
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 29 |
1 files changed, 25 insertions, 4 deletions
@@ -452,6 +452,17 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg, return M_PROPERTY_OK; } +/// Number of chapters in file +static int mp_property_chapters(m_option_t *prop, int action, void *arg, + MPContext *mpctx) +{ + if (!mpctx->demuxer) + return M_PROPERTY_UNAVAILABLE; + if (mpctx->demuxer->num_chapters == 0) + stream_control(mpctx->demuxer->stream, STREAM_CTRL_GET_NUM_CHAPTERS, &mpctx->demuxer->num_chapters); + return m_property_int_ro(prop, action, arg, mpctx->demuxer->num_chapters); +} + /// Current dvd angle (RW) static int mp_property_angle(m_option_t *prop, int action, void *arg, MPContext *mpctx) @@ -548,6 +559,12 @@ static int mp_property_metadata(m_option_t *prop, int action, void *arg, return M_PROPERTY_NOT_IMPLEMENTED; } +static int mp_property_pause(m_option_t * prop, int action, void *arg, + MPContext * mpctx) +{ + return m_property_flag_ro(prop, action, arg, mpctx->osd_function == OSD_PAUSE); +} + ///@} @@ -1992,10 +2009,14 @@ static const m_option_t mp_properties[] = { M_OPT_MIN, 0, 0, NULL }, { "chapter", mp_property_chapter, CONF_TYPE_INT, M_OPT_MIN, 1, 0, NULL }, + { "chapters", mp_property_chapters, CONF_TYPE_INT, + 0, 0, 0, NULL }, { "angle", mp_property_angle, CONF_TYPE_INT, CONF_RANGE, -2, 10, NULL }, { "metadata", mp_property_metadata, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL }, + { "pause", mp_property_pause, CONF_TYPE_FLAG, + M_OPT_RANGE, 0, 1, NULL }, // Audio { "volume", mp_property_volume, CONF_TYPE_FLOAT, @@ -2624,7 +2645,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) play_tree_add_file(e, cmd->args[0].v.s); if (cmd->args[1].v.i) // append - play_tree_append_entry(mpctx->playtree, e); + play_tree_append_entry(mpctx->playtree->child, e); else { // Go back to the starting point. while (play_tree_iter_up_step @@ -2632,7 +2653,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) /* NOP */ ; play_tree_free_list(mpctx->playtree->child, 1); play_tree_set_child(mpctx->playtree, e); - play_tree_iter_step(mpctx->playtree_iter, 0, 0); + pt_iter_goto_head(mpctx->playtree_iter); mpctx->stop_play = PT_NEXT_SRC; } brk_cmd = 1; @@ -2646,7 +2667,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) MSGTR_PlaylistLoadUnable, cmd->args[0].v.s); else { if (cmd->args[1].v.i) // append - play_tree_append_entry(mpctx->playtree, e); + play_tree_append_entry(mpctx->playtree->child, e); else { // Go back to the starting point. while (play_tree_iter_up_step @@ -2655,7 +2676,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd) /* NOP */ ; play_tree_free_list(mpctx->playtree->child, 1); play_tree_set_child(mpctx->playtree, e); - play_tree_iter_step(mpctx->playtree_iter, 0, 0); + pt_iter_goto_head(mpctx->playtree_iter); mpctx->stop_play = PT_NEXT_SRC; } } |