mirror of
https://github.com/mpv-player/mpv
synced 2025-01-13 10:26:09 +00:00
command: fix video-rotate update when paused
Due to the way video-rotate currently works, the state will be automatically updated once new video is decoded. So the filter chain doesn't need to be reinitialized automatically, but there is a need to trigger the video instant refresh code path instead. Also move the support function closer to an annoying similar yet different function. They probably can be unified next time major changes are done to this code.
This commit is contained in:
parent
bd315dfaf9
commit
4d5903f915
@ -2015,6 +2015,16 @@ static int video_refresh_property_helper(struct m_property *prop, int action,
|
||||
return r;
|
||||
}
|
||||
|
||||
static int video_simple_refresh_property(void *ctx, struct m_property *prop,
|
||||
int action, void *arg)
|
||||
{
|
||||
MPContext *mpctx = ctx;
|
||||
int r = mp_property_generic_option(mpctx, prop, action, arg);
|
||||
if (action == M_PROPERTY_SET && r == M_PROPERTY_OK)
|
||||
mp_force_video_refresh(mpctx);
|
||||
return r;
|
||||
}
|
||||
|
||||
static void append_csp(char **ptr, const char *name, const char *const *names,
|
||||
int value)
|
||||
{
|
||||
@ -2827,16 +2837,6 @@ static int mp_property_af(void *ctx, struct m_property *prop,
|
||||
return property_filter(prop, action, arg, ctx, STREAM_AUDIO);
|
||||
}
|
||||
|
||||
static int property_reinit_vf_helper(void *ctx, struct m_property *prop,
|
||||
int action, void *arg)
|
||||
{
|
||||
MPContext *mpctx = ctx;
|
||||
int r = mp_property_generic_option(mpctx, prop, action, arg);
|
||||
if (action == M_PROPERTY_SET && r == M_PROPERTY_OK)
|
||||
reinit_video_filters(mpctx);
|
||||
return r;
|
||||
}
|
||||
|
||||
static int mp_property_alias(void *ctx, struct m_property *prop,
|
||||
int action, void *arg)
|
||||
{
|
||||
@ -3078,7 +3078,7 @@ static const struct m_property mp_properties[] = {
|
||||
{"vf", mp_property_vf},
|
||||
{"af", mp_property_af},
|
||||
|
||||
{"video-rotate", property_reinit_vf_helper},
|
||||
{"video-rotate", video_simple_refresh_property},
|
||||
|
||||
#define PROPERTY_TV_COLOR(name, type) \
|
||||
{name, mp_property_tv_color, (void *)(intptr_t)type}
|
||||
|
Loading…
Reference in New Issue
Block a user