From 5985316fba3b886699cc7f237bf10466d113fd08 Mon Sep 17 00:00:00 2001 From: Ivan Uskov Date: Thu, 9 Jul 2015 22:01:00 +0300 Subject: [PATCH] libavcodec/qsvenc.c: improving handling for return codes of MFXVideoENCODE_EncodeFrameAsync Signed-off-by: Michael Niedermayer --- libavcodec/qsvenc.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index 5f59b6c702..3f376399c9 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -417,12 +417,20 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, break; } while ( 1 ); - if (ret < 0) - return (ret == MFX_ERR_MORE_DATA) ? 0 : ff_qsv_error(ret); - - if (ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM && frame->interlaced_frame) - print_interlace_msg(avctx, q); + if (ret < 0) { + if (ret == MFX_ERR_MORE_DATA) + return 0; + av_log(avctx, AV_LOG_ERROR, "EncodeFrameAsync returned %d\n", ret); + return ff_qsv_error(ret); + } + if (ret == MFX_WRN_INCOMPATIBLE_VIDEO_PARAM) { + if (frame->interlaced_frame) + print_interlace_msg(avctx, q); + else + av_log(avctx, AV_LOG_WARNING, + "EncodeFrameAsync returned 'incompatible param' code\n"); + } if (sync) { MFXVideoCORE_SyncOperation(q->session, sync, 60000);