On Tue, Jul 21, 2015 at 8:43 AM, Steve Lhomme <[email protected]> wrote:
> In case the VideoContext is used by different threads internally or
> other threads externally
> ---
>  libavcodec/d3d11va.h |  5 +++++
>  libavcodec/dxva2.c   | 15 +++++++++++++--
>  libavcodec/version.h |  4 ++--
>  3 files changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/d3d11va.h b/libavcodec/d3d11va.h
> index 2163b35..05d4fa6 100644
> --- a/libavcodec/d3d11va.h
> +++ b/libavcodec/d3d11va.h
> @@ -89,6 +89,11 @@ struct AVD3D11VAContext {
>       * Private to the Libav AVHWAccel implementation
>       */
>      unsigned report_id;
> +
> +    /**
> +      * Mutex to access video_context
> +      */
> +    HANDLE  context_mutex;
>  };
>

Without an allocation function to alloc this struct and init the
handle properly (since its init value is not 0, but
INVALID_HANDLE_VALUE), this seems like it might very easily run into
issues.

Why would the context be used by other threads, anyway? avcodec
certainly won't if you use it properly.

- Hendrik
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to