[vlc-devel] [vlc-commits] dxva2: allocate the requested number of surfaces

Steve Lhomme robux4 at gmail.com
Tue Aug 2 13:24:32 CEST 2016


Although it fixes the issue, the fix is wrong. It allocates one extra
buffer for no good reason.
A different workaround for this issue is coming.

On Tue, Aug 2, 2016 at 11:24 AM, Steve Lhomme <git at videolan.org> wrote:
> vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Aug  2 11:15:07 2016 +0200| [af4f23a8866e7c111e7ef43381123633b6ea15c4] | committer: Jean-Baptiste Kempf
>
> dxva2: allocate the requested number of surfaces
>
> The +1 of CreateSurface is an internal thing. There are cases where the
> allocation succeeds but the use of buffer crashes as soon as we do BeginFrame().
> This change fixes this crash. Either we can allocate and it works, either we
> can't allocate and it won't crash.
>
> Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
>
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=af4f23a8866e7c111e7ef43381123633b6ea15c4
> ---
>
>  modules/codec/avcodec/dxva2.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
> index 583a236..f08865f 100644
> --- a/modules/codec/avcodec/dxva2.c
> +++ b/modules/codec/avcodec/dxva2.c
> @@ -703,7 +703,7 @@ static int DxCreateVideoDecoder(vlc_va_t *va, int codec_id, const video_format_t
>      hr = IDirectXVideoDecoderService_CreateSurface((IDirectXVideoDecoderService*) sys->d3ddec,
>                                                           sys->surface_width,
>                                                           sys->surface_height,
> -                                                         sys->surface_count - 1,
> +                                                         sys->surface_count,
>                                                           p_sys->render,
>                                                           D3DPOOL_DEFAULT,
>                                                           0,
>
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits


More information about the vlc-devel mailing list