mirror of
https://github.com/mpv-player/mpv
synced 2025-03-09 23:58:06 +00:00
command: use property_time() for sub-start and sub-end
This gives these properties the "time" type, which allows them to be pretty-printed as HH:MM:SS easily (but also still allows raw formatting using e.g. ${=sub-start}).
This commit is contained in:
parent
2f8038c598
commit
d3a63e16d2
1
DOCS/interface-changes/sub-times.txt
Normal file
1
DOCS/interface-changes/sub-times.txt
Normal file
@ -0,0 +1 @@
|
||||
change type of `sub-start` and `sub-end` properties to time
|
@ -2867,6 +2867,11 @@ Property list
|
||||
subtitles, returns the first start time. If no current subtitle is present
|
||||
null is returned instead.
|
||||
|
||||
This has a sub-property:
|
||||
|
||||
``sub-start/full``
|
||||
``sub-start`` with milliseconds.
|
||||
|
||||
``secondary-sub-start``
|
||||
Same as ``sub-start``, but for the secondary subtitles.
|
||||
|
||||
@ -2876,6 +2881,11 @@ Property list
|
||||
if it's present but has unknown or incorrect duration, null is returned
|
||||
instead.
|
||||
|
||||
This has a sub-property:
|
||||
|
||||
``sub-end/full``
|
||||
``sub-end`` with milliseconds.
|
||||
|
||||
``secondary-sub-end``
|
||||
Same as ``sub-end``, but for the secondary subtitles.
|
||||
|
||||
|
@ -3062,7 +3062,7 @@ static int mp_property_sub_start(void *ctx, struct m_property *prop,
|
||||
double start = get_times(ctx, prop, action, arg).start;
|
||||
if (start == MP_NOPTS_VALUE)
|
||||
return M_PROPERTY_UNAVAILABLE;
|
||||
return m_property_double_ro(action, arg, start);
|
||||
return property_time(action, arg, start);
|
||||
}
|
||||
|
||||
|
||||
@ -3072,7 +3072,7 @@ static int mp_property_sub_end(void *ctx, struct m_property *prop,
|
||||
double end = get_times(ctx, prop, action, arg).end;
|
||||
if (end == MP_NOPTS_VALUE)
|
||||
return M_PROPERTY_UNAVAILABLE;
|
||||
return m_property_double_ro(action, arg, end);
|
||||
return property_time(action, arg, end);
|
||||
}
|
||||
|
||||
static int mp_property_playlist_current_pos(void *ctx, struct m_property *prop,
|
||||
|
Loading…
Reference in New Issue
Block a user