Mercurial > mplayer.hg
changeset 8364:137b7574c85f
slave-mode commands to get movie length & pos
patch by Balatoni Denes <pnis@coder.hu>
author | arpi |
---|---|
date | Thu, 05 Dec 2002 00:11:12 +0000 |
parents | ae74be3e2ed0 |
children | 423a19edc0a4 |
files | input/input.c input/input.h mplayer.c |
diffstat | 3 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/input/input.c Thu Dec 05 00:07:59 2002 +0000 +++ b/input/input.c Thu Dec 05 00:11:12 2002 +0000 @@ -67,6 +67,8 @@ { MP_CMD_SUB_POS, "sub_pos", 1, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_SUB_VISIBILITY, "sub_visibility", 0, { {-1,{0}} } }, { MP_CMD_VOBSUB_LANG, "vobsub_lang", 0, { {-1,{0}} } }, + { MP_CMD_GET_PERCENT_POS, "get_percent_pos", 0, { {-1,{0}} } }, + { MP_CMD_GET_TIME_LENGTH, "get_time_length", 0, { {-1,{0}} } }, #ifdef USE_TV { MP_CMD_TV_STEP_CHANNEL, "tv_step_channel", 1, { { MP_CMD_ARG_INT ,{0}}, {-1,{0}} }}, { MP_CMD_TV_STEP_NORM, "tv_step_norm",0, { {-1,{0}} } },
--- a/input/input.h Thu Dec 05 00:07:59 2002 +0000 +++ b/input/input.h Thu Dec 05 00:11:12 2002 +0000 @@ -33,6 +33,8 @@ #define MP_CMD_VOBSUB_LANG 31 #define MP_CMD_MENU 32 #define MP_CMD_SET_MENU 33 +#define MP_CMD_GET_TIME_LENGTH 34 +#define MP_CMD_GET_PERCENT_POS 35 #define MP_CMD_GUI_EVENTS 5000 #define MP_CMD_GUI_LOADFILE 5001
--- a/mplayer.c Thu Dec 05 00:07:59 2002 +0000 +++ b/mplayer.c Thu Dec 05 00:11:12 2002 +0000 @@ -2350,6 +2350,15 @@ case MP_CMD_VF_CHANGE_RECTANGLE: set_rectangle(sh_video, cmd->args[0].v.i, cmd->args[1].v.i); break; + + case MP_CMD_GET_TIME_LENGTH : { + mp_msg(MSGT_GLOBAL,MSGL_INFO,"ANS_LENGTH=%ld\n", demuxer_get_time_length(demuxer)); + } break; + + case MP_CMD_GET_PERCENT_POS : { + mp_msg(MSGT_GLOBAL,MSGL_INFO,"ANS_PERCENT_POSITION=%ld\n", demuxer_get_percent_pos(demuxer)); + } break; + #ifdef USE_DVDNAV case MP_CMD_DVDNAV_EVENT: { dvdnav_priv_t * dvdnav_priv = (dvdnav_priv_t*)(stream->priv);