mirror of
https://github.com/mpv-player/mpv
synced 2025-02-16 12:17:12 +00:00
player/command: move sub-text-ass to a sub-property
This commit is contained in:
parent
aa0a9ce2ec
commit
437fff9f21
1
DOCS/interface-changes/sub-text-ass.txt
Normal file
1
DOCS/interface-changes/sub-text-ass.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
deprecate `sub-text-ass` property; add `sub-text/ass` sub-property
|
@ -2823,19 +2823,24 @@ Property list
|
|||||||
stripped. If the subtitle is not text-based (i.e. DVD/BD subtitles), an
|
stripped. If the subtitle is not text-based (i.e. DVD/BD subtitles), an
|
||||||
empty string is returned.
|
empty string is returned.
|
||||||
|
|
||||||
``sub-text-ass``
|
This has sub-properties for different formats:
|
||||||
Like ``sub-text``, but return the text in ASS format. Text subtitles in
|
|
||||||
other formats are converted. For native ASS subtitles, events that do
|
|
||||||
not contain any text (but vector drawings etc.) are not filtered out. If
|
|
||||||
multiple events match with the current playback time, they are concatenated
|
|
||||||
with line breaks. Contains only the "Text" part of the events.
|
|
||||||
|
|
||||||
This property is not enough to render ASS subtitles correctly, because ASS
|
``sub-text/ass``
|
||||||
header and per-event metadata are not returned. You likely need to do
|
Like ``sub-text``, but return the text in ASS format. Text subtitles in
|
||||||
further filtering on the returned string to make it useful.
|
other formats are converted. For native ASS subtitles, events that do
|
||||||
|
not contain any text (but vector drawings etc.) are not filtered out. If
|
||||||
|
multiple events match with the current playback time, they are concatenated
|
||||||
|
with line breaks. Contains only the "Text" part of the events.
|
||||||
|
|
||||||
|
This property is not enough to render ASS subtitles correctly, because ASS
|
||||||
|
header and per-event metadata are not returned. You likely need to do
|
||||||
|
further filtering on the returned string to make it useful.
|
||||||
|
|
||||||
|
``sub-text-ass`` (deprecated)
|
||||||
|
Deprecated alias for ``sub-text/ass``.
|
||||||
|
|
||||||
``secondary-sub-text``
|
``secondary-sub-text``
|
||||||
Same as ``sub-text``, but for the secondary subtitles.
|
Same as ``sub-text`` (with the same sub-properties), but for the secondary subtitles.
|
||||||
|
|
||||||
``sub-start``
|
``sub-start``
|
||||||
The current subtitle start time (in seconds). If there's multiple current
|
The current subtitle start time (in seconds). If there's multiple current
|
||||||
|
@ -3021,6 +3021,18 @@ static int mp_property_sub_text(void *ctx, struct m_property *prop,
|
|||||||
int sub_index = def[0];
|
int sub_index = def[0];
|
||||||
int type = def[1];
|
int type = def[1];
|
||||||
|
|
||||||
|
if (action == M_PROPERTY_KEY_ACTION) {
|
||||||
|
struct m_property_action_arg *ka = arg;
|
||||||
|
|
||||||
|
if (!strcmp(ka->key, "ass"))
|
||||||
|
type = SD_TEXT_TYPE_ASS;
|
||||||
|
else
|
||||||
|
return M_PROPERTY_UNKNOWN;
|
||||||
|
|
||||||
|
action = ka->action;
|
||||||
|
arg = ka->arg;
|
||||||
|
}
|
||||||
|
|
||||||
struct track *track = mpctx->current_track[sub_index][STREAM_SUB];
|
struct track *track = mpctx->current_track[sub_index][STREAM_SUB];
|
||||||
struct dec_sub *sub = track ? track->d_sub : NULL;
|
struct dec_sub *sub = track ? track->d_sub : NULL;
|
||||||
double pts = mpctx->playback_pts;
|
double pts = mpctx->playback_pts;
|
||||||
|
Loading…
Reference in New Issue
Block a user