[MPlayer-users] Feature Request: Get OSD Time as a Slave Command

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Nov 15 19:56:13 CET 2011


On Tue, Nov 15, 2011 at 01:29:15PM -0500, mplayer wrote:
> ISSUE: 
> The slave command get_time_pos returns the file timestamp, but for some file
> formats the timestamp resets.  
> 
> SOLUTION (proposed): 
> However, I noticed that the OSD time displayed is always good.  So why not
> add a slave command 'get_osd_time' to expose the value the OSD is using to
> display -- it appears to me that OSD just asks the demuxer for the current
> time.
> 
> So this is what I think we'd need to add;
> 
> input.h
>   MP_CMD_GET_OSD_TIME,
> 
> input.c
>   { MP_CMD_GET_OSD_TIME, "get_osd_time", 0, { {-1,{0}} } },
> 
> command.c
>   case MP_CMD_GET_OSD_TIME:
>     mp_msg(MSGT_GLOBAL, MSGL_INFO, "ANS_OSD_TIME=%d\n", 
>       demuxer_get_current_time(mpctx->demuxer));

There is no need to add anything. All that demuxer_get_current_time
does is prefer the stream time over pts.
You will get the same by just using
get_property stream_time_pos
and only falling back to
get_property time_pos
when it is not available.


More information about the MPlayer-users mailing list