summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-04 21:47:20 +0100
committerwm4 <wm4@nowhere>2015-11-04 21:49:54 +0100
commit66ed50aa0024244cb12795182449b2769d633607 (patch)
tree396d8fa2476f29aff6128e066ebfdc3a9ec4b305 /video
parent179d7317e7e0e7f824439a47c0bab72b38535de2 (diff)
downloadmpv-66ed50aa0024244cb12795182449b2769d633607.tar.bz2
mpv-66ed50aa0024244cb12795182449b2769d633607.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_vdpau.c8
1 files changed, 6 insertions, 2 deletions
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;