[MPlayer-dev-eng] salve mode - timestamp command added
Andre Merzky
merzky at zib.de
Mon Oct 14 00:02:37 CEST 2002
Hi,
I am about to include mplayer into some Java project
(please don't ask me why.. - really stupid reasons...)
Anyway, easiest way it to catch mplayers stdin/stdout,
and to steer it via the slave mode, since I do not need
much functionality. One thing I do need is a timestamp
though, in order to query the actual movie time.
I append a small patch to the current CVS version,
which does exactly this. I would be happy if someone
could look over it (its just a couple of lines) and
tell me if this makes sense. If it does, I would be
happy to see it go to the CVS tree...
Many thanks, best regards,
Andre.
--
+------------------------------------------------------------------+
| Andre Merzky | phon: ++49 - 30 - 84 1 85 - 339 |
| Zuse Institute Berlin (ZIB) | fax : ++49 - 30 - 84 1 85 - 107 |
| - Scientific Visualization - | mail: merzky at zib.de |
| Takustr. 7 - D-14195 Berlin | www : http://www.zib.de/merzky/ |
+------------------------------------------------------------------+
-------------- next part --------------
begin 644 timestamp.diff
M26YD97 at Z(&UP;&%Y97(N8PH]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]"E)#4R!F
M:6QE.B`O8W9S<F]O="]M<&QA>65R+VUA:6XO;7!L87EE<BYC+'8*<F5T<FEE
M=FEN9R!R979I<VEO;B`Q+C4Y,0ID:69F("UU("TS("UP("UU("UR,2XU.3$@
M;7!L87EE<BYC"BTM+2!M<&QA>65R+F,).2!/8W0@,C`P,B`P,3HQ,SHT,"`M
M,#`P,`DQ+C4Y,0HK*RL@;7!L87EE<BYC"3$S($]C="`R,#`R(#(R.C(R.C0U
M("TP,#`P"D!`("TR,C`U+#8@*S(R,#4L,3, at 0$`@:68@*'-T<F5A;2T^='EP
M93T]4U1214%-5%E015]$5D1.058@)B8 at 9`H@"79O7V]S9%]C:&%N9V5D*$]3
M1%194$5?4U5"5$E43$4I.PH@"6)R96%K.PH@("`@('T**R`@("!C87-E($U0
M7T--1%]424U%4U1!35`@.B!["BL@("`@("!I9B`H<VQA=F5?;6]D92D**R`@
M("`@('L**R`@("`@("`@;7!?;7-G*$U31U1?059364Y#+$U31U1?24Y0550L
M(")T:6UE<W1A;7`Z("4V+C%F7&XB+"!D7W9I9&5O+3YP=',I.PHK("`@("`@
M?0HK("`@("`@8G)E86L["BL@("`@?2`*("`@("!C87-E($U07T--1%]30U)%
M14Y32$]4(#H*("`@("`@(&EF*'9O7V-O;F9I9U]C;W5N="D@=FED96]?;W5T
M+3YC;VYT<F]L*%9/0U123%]30U)%14Y32$]4+"!.54Q,*3L*("`@("`@(&)R
M96%K.PI);F1E>#H@:6YP=70O:6YP=70N8PH]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]"E)#4R!F:6QE.B`O8W9S<F]O="]M<&QA>65R+VUA:6XO:6YP=70O:6YP
M=70N8RQV"G)E=')I979I;F<@<F5V:7-I;VX@,2XT-PID:69F("UU("TS("UP
M("UU("UR,2XT-R!I;G!U="YC"BTM+2!I;G!U="]I;G!U="YC"38 at 3V-T(#(P
M,#(@,3<Z-#`Z-3`@+3`P,#`),2XT-PHK*RL@:6YP=70O:6YP=70N8PDQ,R!/
M8W0@,C`P,B`R,CHR,CHT-B`M,#`P,`I`0"`M-C`L-B`K-C`L-R!`0"!S=&%T
M:6,@;7!?8VUD7W0@;7!?8VUD<UM=(#T@>PH@("![($U07T--1%]&4D%-1412
M3U!024Y'+"`B9G)A;65?9')O<"(L,"P@>R![($U07T--1%]!4D=?24Y4+'LM
M,7T@?2P@>RTQ+'LP?7T@?2!]+`H@("![($U07T--1%]354)?4$]3+"`B<W5B
M7W!O<R(L(#$L('L@>TU07T--1%]!4D=?24Y4+'LP?7TL('M-4%]#341?05)'
M7TE.5"Q[,'U]+"![+3$L>S!]?2!]('TL"B`@('L at 35!?0TU$7U-50E]625-)
M0DE,2519+"`B<W5B7W9I<VEB:6QI='DB+"`P+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V("LS,"PW($!`"B`C9&5F:6YE($U07T--1%]61E]#2$%.1T5?
M4D5#5$%.1TQ%(#(X"B`C9&5F:6YE($U07T--1%]'04U-02`R.0H@(V1E9FEN
M92!-4%]#341?4U5"7U9)4TE"24Q)5%D@,S`**R-D969I;F4 at 35!?0TU$7U1)
M34535$%-4"`S,0H@"B`C9&5F:6YE($U07T--1%]'54E?159%3E13("`@("`@
L(#4P,#`*("-D969I;F4 at 35!?0TU$7T=525],3T%$1DE,12`@("`@-3`P,0H`
`
end
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.591
diff -u -3 -p -u -r1.591 mplayer.c
--- mplayer.c 9 Oct 2002 01:13:40 -0000 1.591
+++ mplayer.c 13 Oct 2002 22:22:45 -0000
@@ -2205,6 +2205,13 @@ if (stream->type==STREAMTYPE_DVDNAV && d
vo_osd_changed(OSDTYPE_SUBTITLE);
break;
}
+ case MP_CMD_TIMESTAMP : {
+ if (slave_mode)
+ {
+ mp_msg(MSGT_AVSYNC,MSGT_INPUT, "timestamp: %6.1f\n", d_video->pts);
+ }
+ break;
+ }
case MP_CMD_SCREENSHOT :
if(vo_config_count) video_out->control(VOCTRL_SCREENSHOT, NULL);
break;
Index: input/input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.47
diff -u -3 -p -u -r1.47 input.c
--- input/input.c 6 Oct 2002 17:40:50 -0000 1.47
+++ input/input.c 13 Oct 2002 22:22:46 -0000
@@ -60,6 +60,7 @@ static mp_cmd_t mp_cmds[] = {
{ MP_CMD_FRAMEDROPPING, "frame_drop",0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } },
{ 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_TIMESTAMP, "timestamp", 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}} } },
@@ -868,6 +869,7 @@ mp_input_read_cmds(int time) {
last_loop %= (num_cmd_fd+1);
continue;
}
+
if( ! (cmd_fds[i].flags & MP_FD_NO_SELECT) && ! FD_ISSET(cmd_fds[i].fd,&fds) && ! (cmd_fds[i].flags & MP_FD_GOT_CMD) )
continue;
Index: input/input.h
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.h,v
retrieving revision 1.19
diff -u -3 -p -u -r1.19 input.h
--- input/input.h 6 Oct 2002 17:40:50 -0000 1.19
+++ input/input.h 13 Oct 2002 22:22:46 -0000
@@ -30,6 +30,7 @@
#define MP_CMD_VF_CHANGE_RECTANGLE 28
#define MP_CMD_GAMMA 29
#define MP_CMD_SUB_VISIBILITY 30
+#define MP_CMD_TIMESTAMP 31
#define MP_CMD_GUI_EVENTS 5000
#define MP_CMD_GUI_LOADFILE 5001
More information about the MPlayer-dev-eng
mailing list