summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-10-17 09:07:35 +0200
committerwm4 <wm4@nowhere>2017-10-17 09:07:35 +0200
commitc90f76d3224f41dda2ac462e3aedcd0dd10ce3cf (patch)
tree9592eb12cb72e376bc328533ae15e53beff58b10 /video
parentb299a3f54656095bd0f038360721d29356c7049d (diff)
downloadmpv-c90f76d3224f41dda2ac462e3aedcd0dd10ce3cf.tar.bz2
mpv-c90f76d3224f41dda2ac462e3aedcd0dd10ce3cf.tar.xz
vo_gpu: fix video sometimes not being rerendered on equalizer change
With video paused, changing the brightness controls (or similar) would sometimes not rerender the video frame. So the OSD would redraw, but the video wouldn't change. This is caused by output caching, and a redraw request is free to return the cached frame. Change it such to invalidate the cached frame if any of the options or the equalizer change. In theory, gl_video_reset_surfaces() could be called if the equalizer changes - this would apparently force interpolatzion to redraw all frames. But this looks kind of crappy when changing the equalizer during playback. It'll "eventually" use the correct settings anyway, and when paused interpolation is off.
Diffstat (limited to 'video')
-rw-r--r--video/out/gpu/video.c10
-rw-r--r--video/out/gpu/video.h1
-rw-r--r--video/out/vo_gpu.c1
-rw-r--r--video/out/vo_opengl_cb.c1
4 files changed, 9 insertions, 4 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c
index 63dd5586c8..89da4ed19f 100644
--- a/video/out/gpu/video.c
+++ b/video/out/gpu/video.c
@@ -424,6 +424,7 @@ static const char *handle_scaler_opt(const char *name, bool tscale);
static void reinit_from_options(struct gl_video *p);
static void get_scale_factors(struct gl_video *p, bool transpose_rot, double xy[2]);
static void gl_video_setup_hooks(struct gl_video *p);
+static void gl_video_update_options(struct gl_video *p);
#define GLSL(x) gl_sc_add(p->sc, #x "\n");
#define GLSLF(...) gl_sc_addf(p->sc, __VA_ARGS__)
@@ -2993,6 +2994,8 @@ static void gl_video_interpolate_frame(struct gl_video *p, struct vo_frame *t,
void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame,
struct ra_fbo fbo)
{
+ gl_video_update_options(p);
+
struct mp_rect target_rc = {0, 0, fbo.tex->params.w, fbo.tex->params.h};
p->broken_frame = false;
@@ -3624,12 +3627,15 @@ static const char *handle_scaler_opt(const char *name, bool tscale)
return NULL;
}
-void gl_video_update_options(struct gl_video *p)
+static void gl_video_update_options(struct gl_video *p)
{
if (m_config_cache_update(p->opts_cache)) {
gl_lcms_update_options(p->cms);
reinit_from_options(p);
}
+
+ if (mp_csp_equalizer_state_changed(p->video_eq))
+ p->output_tex_valid = false;
}
static void reinit_from_options(struct gl_video *p)
@@ -3660,6 +3666,8 @@ static void reinit_from_options(struct gl_video *p)
void gl_video_configure_queue(struct gl_video *p, struct vo *vo)
{
+ gl_video_update_options(p);
+
int queue_size = 1;
// Figure out an adequate size for the interpolation queue. The larger
diff --git a/video/out/gpu/video.h b/video/out/gpu/video.h
index 8b84db8b58..b87390f4d1 100644
--- a/video/out/gpu/video.h
+++ b/video/out/gpu/video.h
@@ -150,7 +150,6 @@ struct gl_video *gl_video_init(struct ra *ra, struct mp_log *log,
struct mpv_global *g);
void gl_video_uninit(struct gl_video *p);
void gl_video_set_osd_source(struct gl_video *p, struct osd_state *osd);
-void gl_video_update_options(struct gl_video *p);
bool gl_video_check_format(struct gl_video *p, int mp_format);
void gl_video_config(struct gl_video *p, struct mp_image_params *params);
void gl_video_set_output_depth(struct gl_video *p, int r, int g, int b);
diff --git a/video/out/vo_gpu.c b/video/out/vo_gpu.c
index 0a0541aabb..00be7b6a00 100644
--- a/video/out/vo_gpu.c
+++ b/video/out/vo_gpu.c
@@ -199,7 +199,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
request_hwdec_api(vo, data);
return true;
case VOCTRL_UPDATE_RENDER_OPTS: {
- gl_video_update_options(p->renderer);
get_and_update_icc_profile(p);
gl_video_configure_queue(p->renderer, p->vo);
p->vo->want_redraw = true;
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index a5fd49ff6f..c903fcd43b 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -291,7 +291,6 @@ int mpv_opengl_cb_draw(mpv_opengl_cb_context *ctx, int fbo, int vp_w, int vp_h)
gl_video_config(ctx->renderer, &ctx->img_params);
}
if (ctx->update_new_opts) {
- gl_video_update_options(ctx->renderer);
if (vo)
gl_video_configure_queue(ctx->renderer, vo);
int debug;