From 66ed50aa0024244cb12795182449b2769d633607 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 4 Nov 2015 21:47:20 +0100 Subject: vo_vdpau: check VDP_RGBA_FORMAT_A8 support Apparently not all vdpau drivers in the wild support this format (VDPAU SUNXI can't). Revert to RGB in these cases. --- video/out/vo_vdpau.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'video/out/vo_vdpau.c') diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index 3bb234f401..73aae1d45c 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -104,6 +104,7 @@ struct vdpctx { VdpRect src_rect_vid; VdpRect out_rect_vid; struct mp_osd_res osd_rect; + VdpBool supports_a8; int surface_num; // indexes output_surfaces int query_surface_num; @@ -711,8 +712,8 @@ static void draw_osd(struct vo *vo) if (!status_ok(vo)) return; - static const bool formats[SUBBITMAP_COUNT] = { - [SUBBITMAP_LIBASS] = true, + bool formats[SUBBITMAP_COUNT] = { + [SUBBITMAP_LIBASS] = vc->supports_a8, [SUBBITMAP_RGBA] = true, }; @@ -1069,6 +1070,9 @@ static int preinit(struct vo *vo) vc->vdp_device = vc->mpvdp->vdp_device; vc->vdp = &vc->mpvdp->vdp; + vc->vdp->bitmap_surface_query_capabilities(vc->vdp_device, VDP_RGBA_FORMAT_A8, + &vc->supports_a8, &(uint32_t){0}, &(uint32_t){0}); + vc->video_eq.capabilities = MP_CSP_EQ_CAPS_COLORMATRIX; return 0; -- cgit v1.2.3