From d37c3c6ebecfe404d2341b897ac9b81adce5f4d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Sat, 9 Jun 2012 15:33:28 +0200 Subject: [PATCH] st/vdpau: clear Cb&Cr with 0.5f MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit That makes the output black in case of decoding errors. Signed-off-by: Christian König --- src/gallium/state_trackers/vdpau/surface.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c index fde2336ca11..cc866a6ca0d 100644 --- a/src/gallium/state_trackers/vdpau/surface.c +++ b/src/gallium/state_trackers/vdpau/surface.c @@ -355,12 +355,15 @@ vlVdpVideoSurfaceClear(vlVdpSurface *vlsurf) surfaces = vlsurf->video_buffer->get_surfaces(vlsurf->video_buffer); for (i = 0; i < VL_MAX_SURFACES; ++i) { - union pipe_color_union black = {}; + union pipe_color_union c = {}; if (!surfaces[i]) continue; - pipe->clear_render_target(pipe, surfaces[i], &black, 0, 0, + if (i > !!vlsurf->templat.interlaced) + c.f[0] = c.f[1] = c.f[2] = c.f[3] = 0.5f; + + pipe->clear_render_target(pipe, surfaces[i], &c, 0, 0, surfaces[i]->width, surfaces[i]->height); } pipe->flush(pipe, NULL); -- 2.30.2