summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--input/input.c2
-rw-r--r--input/input.h2
-rw-r--r--mplayer.c9
3 files changed, 13 insertions, 0 deletions
diff --git a/input/input.c b/input/input.c
index d118ddf433..da633146eb 100644
--- a/input/input.c
+++ b/input/input.c
@@ -67,6 +67,8 @@ static mp_cmd_t mp_cmds[] = {
{ 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}} } },
diff --git a/input/input.h b/input/input.h
index 76e826f3a7..20f22cadff 100644
--- a/input/input.h
+++ b/input/input.h
@@ -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
diff --git a/mplayer.c b/mplayer.c
index df099c19a5..73bfaa60a3 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2350,6 +2350,15 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
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);