[FFmpeg-devel] [PATCH V1 2/2] lavc/vaapi_encode: fix slices number check.

Mark Thompson sw at jkqxz.net
Sun Dec 9 20:08:37 EET 2018


On 06/12/2018 10:39, Jun Zhao wrote:
> Fix slice number check logic. Only when the user setting slices
> number more than the driver constraints dump the rounded up warning
> message.
> 
> Signed-off-by: Jun Zhao <mypopydev at gmail.com>
> ---
>  libavcodec/vaapi_encode.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
> index eda8a36..3c8a33d 100644
> --- a/libavcodec/vaapi_encode.c
> +++ b/libavcodec/vaapi_encode.c
> @@ -1572,7 +1572,7 @@ static av_cold int vaapi_encode_init_slice_structure(AVCodecContext *avctx)
>          return AVERROR(EINVAL);
>      }
>  
> -    if (ctx->nb_slices > avctx->slices) {
> +    if (ctx->nb_slices < avctx->slices) {
>          av_log(avctx, AV_LOG_WARNING, "Slice count rounded up to "
>                 "%d (from %d) due to driver constraints on slice "
>                 "structure.\n", ctx->nb_slices, avctx->slices);
> 

No?  The existing check looks right to me - we warn if the number got increased over what the user specified due to driver constraints.  (We don't allow it to decrease unless the supplied number is larger than the number of rows, which gets warned about above there.)

- Mark


More information about the ffmpeg-devel mailing list