summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-23 18:15:40 +0100
committerwm4 <wm4@nowhere>2015-03-23 18:15:40 +0100
commita09e5dd89110dd96a7342ff0c80c9ede0dadc3a9 (patch)
tree846c253ea24cd5035b736d4eebfe653b15712002 /video
parent7363b0439fba27a368028480bac42f0eddb20ff5 (diff)
downloadmpv-a09e5dd89110dd96a7342ff0c80c9ede0dadc3a9.tar.bz2
mpv-a09e5dd89110dd96a7342ff0c80c9ede0dadc3a9.tar.xz
vo_vdpau: remove some minor code duplication
The way-too-big API call for clearing the screen can be easily shared between two completely different codepaths.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_vdpau.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 93b5cee5d3..3f5776ad36 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -163,19 +163,10 @@ static int render_video_to_output_surface(struct vo *vo,
CHECK_VDP_WARNING(vo, "Error when calling "
"vdp_presentation_queue_block_until_surface_idle");
- if (!mpi) {
- // At least clear the screen if there is nothing to render
- int flags = VDP_OUTPUT_SURFACE_RENDER_ROTATE_0;
- vdp_st = vdp->output_surface_render_output_surface(output_surface,
- NULL, vc->black_pixel,
- NULL, NULL, NULL,
- flags);
- return -1;
- }
-
- if (vc->rgb_mode) {
- // Clear the borders between video and window (if there are any).
- // For some reason, video_mixer_render doesn't need it for YUV.
+ // Clear the borders between video and window (if there are any).
+ // For some reason, video_mixer_render doesn't need it for YUV.
+ // Also, if there is nothing to render, at least clear the screen.
+ if (vc->rgb_mode || !mpi) {
int flags = VDP_OUTPUT_SURFACE_RENDER_ROTATE_0;
vdp_st = vdp->output_surface_render_output_surface(output_surface,
NULL, vc->black_pixel,
@@ -184,6 +175,9 @@ static int render_video_to_output_surface(struct vo *vo,
CHECK_VDP_WARNING(vo, "Error clearing screen");
}
+ if (!mpi)
+ return -1;
+
struct mp_vdpau_mixer_frame *frame = mp_vdpau_mixed_frame_get(mpi);
struct mp_vdpau_mixer_opts opts = {0};
if (frame)