On 04/05/17 07:44, wm4 wrote:
> So a hwaccel can access avctx->hwaccel in init for whatever reason. This
> is for the new d3d hwaccel API. We could create separate entrypoints for
> each of the 3 hwaccel types (dxva2, d3d11va, new d3d11va), but this
> seems nicer.
> ---
>  libavcodec/decode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index 8aa27095b6..f7cb05851d 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -740,16 +740,16 @@ static int setup_hwaccel(AVCodecContext *avctx,
>              return AVERROR(ENOMEM);
>      }
>  
> +    avctx->hwaccel = hwa;
>      if (hwa->init) {
>          ret = hwa->init(avctx);
>          if (ret < 0) {
>              av_freep(&avctx->internal->hwaccel_priv_data);
> +            avctx->hwaccel = NULL;
>              return ret;
>          }
>      }
>  
> -    avctx->hwaccel = hwa;
> -
>      return 0;
>  }

LGTM.  (That is, I can't see any way that this could cause problems anywhere 
else...  :)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to