mirror of https://github.com/mpv-player/mpv
command: export A/V sync difference as "avsync" property
This is the same as on the status line after the "A-V: ".
This commit is contained in:
parent
7a1396b6ca
commit
4e8e7d91dd
|
@ -266,6 +266,7 @@ stream-end end position in bytes in source stream
|
||||||
stream-length length in bytes (${stream-end} - ${stream-start})
|
stream-length length in bytes (${stream-end} - ${stream-start})
|
||||||
stream-time-pos x time position in source stream (also see time-pos)
|
stream-time-pos x time position in source stream (also see time-pos)
|
||||||
length length of the current file in seconds
|
length length of the current file in seconds
|
||||||
|
avsync last A/V synchronization difference
|
||||||
percent-pos x position in current file (0-100)
|
percent-pos x position in current file (0-100)
|
||||||
time-pos x position in current file in seconds
|
time-pos x position in current file in seconds
|
||||||
chapter x current chapter number
|
chapter x current chapter number
|
||||||
|
|
|
@ -285,6 +285,14 @@ static int mp_property_length(m_option_t *prop, int action, void *arg,
|
||||||
return m_property_double_ro(prop, action, arg, len);
|
return m_property_double_ro(prop, action, arg, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mp_property_avsync(m_option_t *prop, int action, void *arg,
|
||||||
|
MPContext *mpctx)
|
||||||
|
{
|
||||||
|
if (!mpctx->sh_audio || !mpctx->sh_video)
|
||||||
|
return M_PROPERTY_UNAVAILABLE;
|
||||||
|
return m_property_double_ro(prop, action, arg, mpctx->last_av_difference);
|
||||||
|
}
|
||||||
|
|
||||||
/// Current position in percent (RW)
|
/// Current position in percent (RW)
|
||||||
static int mp_property_percent_pos(m_option_t *prop, int action,
|
static int mp_property_percent_pos(m_option_t *prop, int action,
|
||||||
void *arg, MPContext *mpctx)
|
void *arg, MPContext *mpctx)
|
||||||
|
@ -1383,6 +1391,7 @@ static const m_option_t mp_properties[] = {
|
||||||
M_OPT_MIN, 0, 0, NULL },
|
M_OPT_MIN, 0, 0, NULL },
|
||||||
{ "length", mp_property_length, CONF_TYPE_TIME,
|
{ "length", mp_property_length, CONF_TYPE_TIME,
|
||||||
M_OPT_MIN, 0, 0, NULL },
|
M_OPT_MIN, 0, 0, NULL },
|
||||||
|
{ "avsync", mp_property_avsync, CONF_TYPE_DOUBLE },
|
||||||
{ "percent-pos", mp_property_percent_pos, CONF_TYPE_INT,
|
{ "percent-pos", mp_property_percent_pos, CONF_TYPE_INT,
|
||||||
M_OPT_RANGE, 0, 100, NULL },
|
M_OPT_RANGE, 0, 100, NULL },
|
||||||
{ "time-pos", mp_property_time_pos, CONF_TYPE_TIME,
|
{ "time-pos", mp_property_time_pos, CONF_TYPE_TIME,
|
||||||
|
|
Loading…
Reference in New Issue