mirror of
https://github.com/mpv-player/mpv
synced 2025-04-17 04:40:09 +00:00
player: Apply new sub-speed values during playback
This commit is contained in:
parent
08cbac311d
commit
00f8ee573b
@ -20,6 +20,7 @@ Interface changes
|
|||||||
::
|
::
|
||||||
|
|
||||||
--- mpv 0.21.0 ---
|
--- mpv 0.21.0 ---
|
||||||
|
- implement changing sub-speed during playback
|
||||||
- deprecate _all_ --vo and --ao suboptions. Generally, all suboptions are
|
- deprecate _all_ --vo and --ao suboptions. Generally, all suboptions are
|
||||||
replaced by global options, which do exactly the same. For example,
|
replaced by global options, which do exactly the same. For example,
|
||||||
"--vo=opengl:scale=nearest" turns into "--scale=nearest". In some cases,
|
"--vo=opengl:scale=nearest" turns into "--scale=nearest". In some cases,
|
||||||
|
@ -2942,6 +2942,26 @@ static int mp_property_sub_delay(void *ctx, struct m_property *prop,
|
|||||||
return property_osd_helper(mpctx, prop, action, arg);
|
return property_osd_helper(mpctx, prop, action, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Subtitle speed (RW)
|
||||||
|
static int mp_property_sub_speed(void *ctx, struct m_property *prop,
|
||||||
|
int action, void *arg)
|
||||||
|
{
|
||||||
|
MPContext *mpctx = ctx;
|
||||||
|
struct MPOpts *opts = mpctx->opts;
|
||||||
|
switch (action) {
|
||||||
|
case M_PROPERTY_SET: {
|
||||||
|
opts->sub_speed = *(float *)arg;
|
||||||
|
struct track *track = mpctx->current_track[0][STREAM_SUB];
|
||||||
|
struct dec_sub *sub = track ? track->d_sub : NULL;
|
||||||
|
if (sub) {
|
||||||
|
sub_control(track->d_sub, SD_CTRL_UPDATE_SPEED, NULL);
|
||||||
|
}
|
||||||
|
return M_PROPERTY_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return property_osd_helper(mpctx, prop, action, arg);
|
||||||
|
}
|
||||||
|
|
||||||
static int mp_property_sub_pos(void *ctx, struct m_property *prop,
|
static int mp_property_sub_pos(void *ctx, struct m_property *prop,
|
||||||
int action, void *arg)
|
int action, void *arg)
|
||||||
{
|
{
|
||||||
@ -3836,6 +3856,7 @@ static const struct m_property mp_properties_base[] = {
|
|||||||
{"sid", mp_property_sub},
|
{"sid", mp_property_sub},
|
||||||
{"secondary-sid", mp_property_sub2},
|
{"secondary-sid", mp_property_sub2},
|
||||||
{"sub-delay", mp_property_sub_delay},
|
{"sub-delay", mp_property_sub_delay},
|
||||||
|
{"sub-speed", mp_property_sub_speed},
|
||||||
{"sub-pos", mp_property_sub_pos},
|
{"sub-pos", mp_property_sub_pos},
|
||||||
{"sub-text", mp_property_sub_text},
|
{"sub-text", mp_property_sub_text},
|
||||||
{"sub-visibility", property_osd_helper},
|
{"sub-visibility", property_osd_helper},
|
||||||
|
Loading…
Reference in New Issue
Block a user