summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-10 14:05:42 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-03-11 12:49:40 +0900
commit76809e5ef7134a1eb09d4731c4864edeae4aa3ac (patch)
treefecdf47d2f98def6a2d864093bbc00c37a009a2a
parentefc72daea937fe5942c2e4e39e7f781082a5d65f (diff)
downloadmpv-76809e5ef7134a1eb09d4731c4864edeae4aa3ac.tar.bz2
mpv-76809e5ef7134a1eb09d4731c4864edeae4aa3ac.tar.xz
vo_opengl_cb: clear last video frame on uninit()
mpv_opengl_cb_render() is supposed to clear the screen with the background color if there's no video... I think. It didn't do this, because although uninit() requested gl_video_config() to be called, this didn't happen, because this function checks whether the VO is set - and it's unsert after uninit() releases the lock. Also call the user wakeup callback in this situation, so the user actually redraws immediately. (cherry picked from commit eff265c1400f6795e284d4e7c9054cf288d6c0cf)
-rw-r--r--video/out/vo_opengl_cb.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index 7334d31add..cd04f5219b 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -306,20 +306,20 @@ int mpv_opengl_cb_render(struct mpv_opengl_cb_context *ctx, int fbo, int vp[4])
gl_video_resize(ctx->renderer, &wnd, &src, &dst, &osd, !ctx->flip);
}
- if (vo) {
- struct vo_priv *p = vo->priv;
- if (ctx->reconfigured)
- gl_video_config(ctx->renderer, &ctx->img_params);
- if (ctx->reconfigured || ctx->update_new_opts) {
- struct vo_priv *opts = p->ctx->new_opts ? p->ctx->new_opts : p;
+ if (ctx->reconfigured)
+ gl_video_config(ctx->renderer, &ctx->img_params);
+ if (ctx->update_new_opts) {
+ struct vo_priv *p = vo ? vo->priv : NULL;
+ struct vo_priv *opts = ctx->new_opts ? ctx->new_opts : p;
+ if (opts) {
gl_video_set_options(ctx->renderer, opts->renderer_opts);
ctx->gl->debug_context = opts->use_gl_debug;
gl_video_set_debug(ctx->renderer, opts->use_gl_debug);
frame_queue_shrink(ctx, opts->frame_queue_size);
}
- ctx->reconfigured = false;
- ctx->update_new_opts = false;
}
+ ctx->reconfigured = false;
+ ctx->update_new_opts = false;
struct mp_csp_equalizer *eq = gl_video_eq_ptr(ctx->renderer);
if (ctx->eq_changed) {
@@ -507,6 +507,7 @@ static void uninit(struct vo *vo)
p->ctx->img_params = (struct mp_image_params){0};
p->ctx->reconfigured = true;
p->ctx->active = NULL;
+ update(p);
pthread_mutex_unlock(&p->ctx->lock);
}