From 64f9e48bf1d67ed22f2488f7135a082a8ffbe716 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 29 Apr 2016 23:28:15 +0200 Subject: d3d11va, dxva2: return the format struct directly Slight simplification, IMHO. --- video/decode/dxva2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'video/decode/dxva2.c') diff --git a/video/decode/dxva2.c b/video/decode/dxva2.c index 0fd4acafba..c851859b6b 100644 --- a/video/decode/dxva2.c +++ b/video/decode/dxva2.c @@ -197,12 +197,12 @@ static int dxva2_init_decoder(struct lavc_ctx *s, int w, int h) d3d9_formats, MP_ARRAY_SIZE(d3d9_formats), dxva2_format_supported); CoTaskMemFree(device_guids); - if (fmt.mpfmt_decoded == IMGFMT_NONE) { + if (!fmt.format) { MP_ERR(p, "Failed to find a suitable decoder\n"); goto done; } - p->mpfmt_decoded = fmt.mpfmt_decoded; + p->mpfmt_decoded = fmt.format->mpfmt; struct mp_image_pool *decoder_pool = talloc_steal(tmp, mp_image_pool_new(n_surfaces)); DXVA2_ConfigPictureDecode *decoder_config = @@ -213,7 +213,7 @@ static int dxva2_init_decoder(struct lavc_ctx *s, int w, int h) DXVA2_VideoDesc video_desc ={ .SampleWidth = w, .SampleHeight = h, - .Format = fmt.dxfmt_decoded, + .Format = fmt.format->dxfmt, }; UINT n_configs = 0; DXVA2_ConfigPictureDecode *configs = NULL; @@ -246,7 +246,7 @@ static int dxva2_init_decoder(struct lavc_ctx *s, int w, int h) hr = IDirectXVideoDecoderService_CreateSurface( p->decoder_service, w_align, h_align, - n_surfaces - 1, fmt.dxfmt_decoded, D3DPOOL_DEFAULT, 0, + n_surfaces - 1, fmt.format->dxfmt, D3DPOOL_DEFAULT, 0, DXVA2_VideoDecoderRenderTarget, surfaces, NULL); if (FAILED(hr)) { MP_ERR(p, "Failed to create %d video surfaces: %s\n", -- cgit v1.2.3