[FFmpeg-devel] [PATCH 2/2] lavc/vaapi_decode: fix profile search when disable exact profile match.

Mark Thompson sw at jkqxz.net
Thu Sep 28 00:40:17 EEST 2017


On 21/09/17 08:22, Jun Zhao wrote:
> From d7dc5c00692302e810412dea44ae3d2f122fb9a4 Mon Sep 17 00:00:00 2001
> From: Jun Zhao <jun.zhao at intel.com>
> Date: Thu, 21 Sep 2017 02:44:42 -0400
> Subject: [PATCH 2/2] lavc/vaapi_decode: fix profile search when disable exact
>  profile match.
> 
> When disable exact profile match, alway use the profile found by
> codecid.
> 
> Signed-off-by: Jun Zhao <jun.zhao at intel.com>
> ---
>  libavcodec/vaapi_decode.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
> index cf58aae4c6..98b00e3637 100644
> --- a/libavcodec/vaapi_decode.c
> +++ b/libavcodec/vaapi_decode.c
> @@ -329,6 +329,10 @@ static int vaapi_decode_make_config(AVCodecContext *avctx)
>              if (exact_match)
>                  break;
>              alt_profile = vaapi_profile_map[i].codec_profile;
> +
> +            if (avctx->hwaccel_flags &
> +                AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH)
> +                break;
>          }
>      }
>      av_freep(&profile_list);
> -- 
> 2.11.0
> 

An exact match might exist later in the list.  Consider an H.264 high input - this change can choose H.264 constrained baseline instead even if H.264 high is present.

- Mark


More information about the ffmpeg-devel mailing list