diff options
author | wm4 <wm4@nowhere> | 2019-11-06 22:42:44 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-11-06 22:42:44 +0100 |
commit | 8a0929973de15d9574595c5a098bb3446757ef16 (patch) | |
tree | b4b2ba54e5bcb4ea7672346fb0e8d186eab29ddf /video/out/gpu/video.c | |
parent | e8aae688c3fa622dca171c77caed69732e14ede2 (diff) | |
download | mpv-8a0929973de15d9574595c5a098bb3446757ef16.tar.bz2 mpv-8a0929973de15d9574595c5a098bb3446757ef16.tar.xz |
vo_gpu: unconditionally clear framebuffer on start of frame
For some reason, the first frame displayed on X11 with amdgpu and OpenGL
will be garbled. This is especially visible if the player starts,
displays a frame, but then still takes a while to properly start
playback.
With --interpolation, the behavior somehow changes (usually gets worse).
I'm not sure what exactly is going on, and the code in video.c is way
too abstruse. Maybe there is some slight possibility that a frame with
uncleared contents gets displayed, which somehow also corrupts another
frame that is displayed immediately after that.
If clear is unconditionally run, this somehow doesn't happen, and you
see a video frame. By any logic this shouldn't happen: a video frame
should always overwrite the background. So I can't exclude that this
isn't some sort of driver bug, or at least very obscure interaction.
Clearing should be practically free anyway, so always do it.
Fixes: #7105
Diffstat (limited to 'video/out/gpu/video.c')
-rw-r--r-- | video/out/gpu/video.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 62ae7de9b7..d6dd7ed8aa 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -3223,11 +3223,9 @@ void gl_video_render_frame(struct gl_video *p, struct vo_frame *frame, bool has_frame = !!frame->current; - if (!has_frame || !mp_rect_equals(&p->dst_rect, &target_rc)) { - struct m_color c = p->clear_color; - float color[4] = {c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0}; - p->ra->fns->clear(p->ra, fbo.tex, color, &target_rc); - } + struct m_color c = p->clear_color; + float clear_color[4] = {c.r / 255.0, c.g / 255.0, c.b / 255.0, c.a / 255.0}; + p->ra->fns->clear(p->ra, fbo.tex, clear_color, &target_rc); if (p->hwdec_overlay) { if (has_frame) { |