diff mbox

[FFmpeg-devel,4/7] hwcontext_vaapi: Fix frames context creation with external attributes

Message ID 20180219232849.29436-4-sw@jkqxz.net
State Accepted
Commit 193e43e6195eba669015098b4245a7287b7506b0
Headers show

Commit Message

Mark Thompson Feb. 19, 2018, 11:28 p.m. UTC
---
 libavutil/hwcontext_vaapi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Philip Langdale Feb. 20, 2018, 12:20 a.m. UTC | #1
On Mon, 19 Feb 2018 23:28:46 +0000
Mark Thompson <sw@jkqxz.net> wrote:

> ---
>  libavutil/hwcontext_vaapi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
> index 68f88ecd6b..af9a136ef0 100644
> --- a/libavutil/hwcontext_vaapi.c
> +++ b/libavutil/hwcontext_vaapi.c
> @@ -475,9 +475,9 @@ static int vaapi_frames_init(AVHWFramesContext
> *hwfc) int need_memory_type = !(hwctx->driver_quirks &
> AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE); int need_pixel_format = 1;
>              for (i = 0; i < avfc->nb_attributes; i++) {
> -                if (ctx->attributes[i].type ==
> VASurfaceAttribMemoryType)
> +                if (avfc->attributes[i].type ==
> VASurfaceAttribMemoryType) need_memory_type  = 0;
> -                if (ctx->attributes[i].type ==
> VASurfaceAttribPixelFormat)
> +                if (avfc->attributes[i].type ==
> VASurfaceAttribPixelFormat) need_pixel_format = 0;
>              }
>              ctx->nb_attributes =

LGTM


--phil
diff mbox

Patch

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 68f88ecd6b..af9a136ef0 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -475,9 +475,9 @@  static int vaapi_frames_init(AVHWFramesContext *hwfc)
             int need_memory_type = !(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_ATTRIB_MEMTYPE);
             int need_pixel_format = 1;
             for (i = 0; i < avfc->nb_attributes; i++) {
-                if (ctx->attributes[i].type == VASurfaceAttribMemoryType)
+                if (avfc->attributes[i].type == VASurfaceAttribMemoryType)
                     need_memory_type  = 0;
-                if (ctx->attributes[i].type == VASurfaceAttribPixelFormat)
+                if (avfc->attributes[i].type == VASurfaceAttribPixelFormat)
                     need_pixel_format = 0;
             }
             ctx->nb_attributes =