From 55c3055784bed2ba7fff5131506f7f95b922fa46 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 22 May 2014 20:55:05 +0200 Subject: [PATCH] vo_vdpau: always allocate the black pixel black_pixel is an (apparently necessary) 1x1 black surface used for clearing the screen. It was allocated in RGB mode only, but is sometimes used in YUV mode too. --- video/out/vo_vdpau.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index d80f5dab48..877a3765bf 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -655,6 +655,12 @@ static int initialize_vdpau_objects(struct vo *vo) &vc->rgb_surfaces[n]); CHECK_VDP_ERROR(vo, "Allocating RGB surface"); } + } else { + if (create_vdp_mixer(vo, vc->vdp_chroma_type) < 0) + return -1; + } + + if (vc->black_pixel == VDP_INVALID_HANDLE) { vdp_st = vdp->output_surface_create(vc->vdp_device, OUTPUT_RGBA_FORMAT, 1, 1, &vc->black_pixel); CHECK_VDP_ERROR(vo, "Allocating clearing surface"); @@ -663,9 +669,6 @@ static int initialize_vdpau_objects(struct vo *vo) (const void*[]){data}, (uint32_t[]){4}, NULL); CHECK_VDP_ERROR(vo, "Initializing clearing surface"); - } else { - if (create_vdp_mixer(vo, vc->vdp_chroma_type) < 0) - return -1; } forget_frames(vo, false);