diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-07-25 09:06:37 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-02 04:14:45 +0200 |
commit | 6ab9a83398dcfdc2d72a831a4f71b3be0be18d2a (patch) | |
tree | eb6f736ce804b4e58f4a49e85128e79d43c0366a /command.c | |
parent | 37097806be4e4874df4062c2d02c0868d437cf58 (diff) | |
download | mpv-6ab9a83398dcfdc2d72a831a4f71b3be0be18d2a.tar.bz2 mpv-6ab9a83398dcfdc2d72a831a4f71b3be0be18d2a.tar.xz |
slave mode: Add stream_time_pos property
Patch by Paul Huwe [reicow yahoo com] with some modifications by me.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31794 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'command.c')
-rw-r--r-- | command.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -371,6 +371,17 @@ static int mp_property_stream_length(m_option_t *prop, int action, return M_PROPERTY_NOT_IMPLEMENTED; } +/// Current stream position in seconds (RO) +static int mp_property_stream_time_pos(m_option_t *prop, int action, + void *arg, MPContext *mpctx) +{ + if (!mpctx->demuxer || mpctx->demuxer->stream_pts == MP_NOPTS_VALUE) + return M_PROPERTY_UNAVAILABLE; + + return m_property_time_ro(prop, action, arg, mpctx->demuxer->stream_pts); +} + + /// Media length in seconds (RO) static int mp_property_length(m_option_t *prop, int action, void *arg, MPContext *mpctx) @@ -2129,6 +2140,8 @@ static const m_option_t mp_properties[] = { M_OPT_MIN, 0, 0, NULL }, { "stream_length", mp_property_stream_length, CONF_TYPE_POSITION, M_OPT_MIN, 0, 0, NULL }, + { "stream_time_pos", mp_property_stream_time_pos, CONF_TYPE_TIME, + M_OPT_MIN, 0, 0, NULL }, { "length", mp_property_length, CONF_TYPE_TIME, M_OPT_MIN, 0, 0, NULL }, { "percent_pos", mp_property_percent_pos, CONF_TYPE_INT, |