[Fwd:,[MPlayer-dev-eng] get_time_pos slave commando]
Commit Message
Would this new addition to mplayer help show the proper position of native .vdr
files in the mplayer plugin?
Best Regards,
Hi,
I think this would be useful addition to slave mode, especially external
Guis sure could need this IMHO.
If nobody objects I intend to apply tomorrow.
Greetings,
Reimar Döffinger
Comments
On 18 May 2005 "C.Y.M" <syphyr@gmail.com> wrote:
> Would this new addition to mplayer help show the proper position of native .vdr
> files in the mplayer plugin?
If it works for all kinds of demuxers IMO: yes.
In theory the old MP_CMD_GET_PERCENT_POS was sufficient, but
unfortunaly worked only for few demuxers.
Regards.
Stefan Huelswitt wrote:
> On 18 May 2005 "C.Y.M" <syphyr@gmail.com> wrote:
>
>
>>Would this new addition to mplayer help show the proper position of native .vdr
>>files in the mplayer plugin?
>
>
> If it works for all kinds of demuxers IMO: yes.
>
> In theory the old MP_CMD_GET_PERCENT_POS was sufficient, but
> unfortunaly worked only for few demuxers.
>
Hmm.. I was unaware of the previous code working with only specific demuxers.
If I had more experience with the code, I would try to implement this new
feature in mplayer, but I doubt that I would be successful. Mainly I just
wanted to see what the consensus was and if anyone thought it was worth a try.
I was curious if the current vdr patch for mplayer was causing the instability
issues when fast forwarding or rewinding over a period of time.
Best Regards,
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.844
@@ -3503,6 +3503,15 @@
case MP_CMD_GET_PERCENT_POS : {
mp_msg(MSGT_GLOBAL,MSGL_INFO,MSGTR_AnsPercentPos, demuxer_get_percent_pos(demuxer));
} break;
+ case MP_CMD_GET_TIME_POS : {
+ float pos = 0;
+ if (sh_video)
+ pos = sh_video->pts;
+ else
+ if (sh_audio && audio_out)
+ pos = sh_audio->delay - audio_out->get_delay() * playback_speed;
+ mp_msg(MSGT_GLOBAL, MSGL_INFO, MSGTR_AnsTimePos, pos);
+ } break;
case MP_CMD_SWITCH_AUDIO : {
int v = demuxer_switch_audio(demuxer, cmd->args[0].v.i);
if (identify)
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/tech/slave.txt,v
retrieving revision 1.37
@@ -132,6 +132,9 @@
get_percent_pos
Print out the current position in the file, as integer percentage [0-100).
+get_time_pos
+ Print out the current position in the filein seconds, as float.
+
get_time_length
Print out the length of the current file in seconds.
===================================================================
RCS file: /cvsroot/mplayer/main/help/help_mp-en.h,v
retrieving revision 1.167
@@ -172,6 +172,7 @@
#define MSGTR_AnsLength "ANS_LENGTH=%ld\n"
#define MSGTR_AnsVoFullscreen "ANS_VO_FULLSCREEN=%ld\n"
#define MSGTR_AnsPercentPos "ANS_PERCENT_POSITION=%ld\n"
+#define MSGTR_AnsTimePos "ANS_TIME_POSITION=%.1f\n"
#define MSGTR_DvdnavNullEvent "DVDNAV Event NULL?!\n"
#define MSGTR_DvdnavHighlightEventBroken "DVDNAV Event: Highlight event broken\n"
#define MSGTR_DvdnavEvent "DVDNAV Event: %s\n"
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.115
@@ -81,6 +81,7 @@
{ 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_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}} } },
{ MP_CMD_SWITCH_AUDIO, "switch_audio", 0, { { MP_CMD_ARG_INT,{-1} }, {-1,{0}} } },
#ifdef USE_TV
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.h,v
retrieving revision 1.54
@@ -64,6 +64,7 @@
#define MP_CMD_RUN 60
#define MP_CMD_SUB_LOG 61
#define MP_CMD_SWITCH_AUDIO 62
+#define MP_CMD_GET_TIME_POS 63
#define MP_CMD_GUI_EVENTS 5000
#define MP_CMD_GUI_LOADFILE 5001