[FFmpeg-devel] vaapi_encode: fix slices number check.

Submitted by Jun Zhao on Oct. 30, 2018, 5:24 a.m.

Details

Message ID 1540877093-25385-1-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao Oct. 30, 2018, 5:24 a.m.
fix slice number check logic.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
 libavcodec/vaapi_encode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

mypopy@gmail.com Nov. 12, 2018, 2:37 a.m.
On Tue, Oct 30, 2018 at 1:25 PM Jun Zhao <mypopydev@gmail.com> wrote:
>
> fix slice number check logic.
>
> Signed-off-by: Jun Zhao <mypopydev@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 2fe8501..bf8f37b 100644
> --- a/libavcodec/vaapi_encode.c
> +++ b/libavcodec/vaapi_encode.c
> @@ -1571,7 +1571,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);
> --
> 1.7.1
>
Ping ?

Patch hide | download patch | download mbox

diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 2fe8501..bf8f37b 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1571,7 +1571,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);