[MPlayer-dev-eng] [PACTH] get_byte_pos slave command
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Apr 18 23:16:44 CEST 2006
Hi,
I think this might be useful, esp. in combination with -sb.
Comments?
Greetings,
Reimar Döffinger
-------------- next part --------------
Index: input/input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.136
diff -u -r1.136 input.c
--- input/input.c 15 Apr 2006 14:24:36 -0000 1.136
+++ input/input.c 18 Apr 2006 19:18:17 -0000
@@ -83,6 +83,7 @@
{ MP_CMD_SUB_SELECT, "vobsub_lang", 0, { { MP_CMD_ARG_INT,{-2} }, {-1,{0}} } }, // for compatibility
{ MP_CMD_SUB_SELECT, "sub_select", 0, { { MP_CMD_ARG_INT,{-2} }, {-1,{0}} } },
{ MP_CMD_SUB_LOG, "sub_log", 0, { {-1,{0}} } },
+ { MP_CMD_GET_BYTE_POS, "get_byte_pos", 0, { {-1,{0}} } },
{ MP_CMD_GET_PERCENT_POS, "get_percent_pos", 0, { {-1,{0}} } },
{ MP_CMD_GET_TIME_POS, "get_time_pos", 0, { {-1,{0}} } },
{ MP_CMD_GET_TIME_LENGTH, "get_time_length", 0, { {-1,{0}} } },
Index: input/input.h
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.h,v
retrieving revision 1.61
diff -u -r1.61 input.h
--- input/input.h 22 Mar 2006 00:19:02 -0000 1.61
+++ input/input.h 18 Apr 2006 19:18:17 -0000
@@ -71,6 +71,7 @@
#define MP_CMD_VO_BORDER 67
#define MP_CMD_SET_PROPERTY 68
#define MP_CMD_GET_PROPERTY 69
+#define MP_CMD_GET_BYTE_POS 70
#define MP_CMD_GUI_EVENTS 5000
#define MP_CMD_GUI_LOADFILE 5001
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.929
diff -u -r1.929 mplayer.c
--- mplayer.c 15 Apr 2006 09:36:53 -0000 1.929
+++ mplayer.c 18 Apr 2006 19:18:36 -0000
@@ -4417,6 +4476,9 @@
mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_VO_FULLSCREEN=%d\n", vo_fs);
} break;
+ case MP_CMD_GET_BYTE_POS : {
+ mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_BYTE_POSITION=%"PRIu64"\n", (uint64_t)stream_tell(demuxer->stream));
+ } break;
case MP_CMD_GET_PERCENT_POS : {
mp_msg(MSGT_GLOBAL,MSGL_INFO, "ANS_PERCENT_POSITION=%d\n", demuxer_get_percent_pos(demuxer));
} break;
Index: DOCS/tech/slave.txt
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/tech/slave.txt,v
retrieving revision 1.56
diff -u -r1.56 slave.txt
--- DOCS/tech/slave.txt 27 Mar 2006 16:43:02 -0000 1.56
+++ DOCS/tech/slave.txt 18 Apr 2006 19:18:38 -0000
@@ -79,6 +79,10 @@
frame_drop [value]
Toggle/set frame dropping mode.
+get_byte_pos
+ Print out the current position in the file in bytes, e.g. for use with the
+ -sb option.
+
get_percent_pos
Print out the current position in the file, as integer percentage [0-100).
More information about the MPlayer-dev-eng
mailing list