X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fqsvdec_other.c;h=993c7a8e807f03b9a8cef68dc586d204c63a5ee7;hb=1a45b12cdc414794795c11db378d0be6113a22d3;hp=3c872dcfc2a9c3e902fbbf4d2f144515faafe380;hpb=be6749c7190e8dd4a5fc44b1efef6cfac3209b5f;p=ffmpeg diff --git a/libavcodec/qsvdec_other.c b/libavcodec/qsvdec_other.c index 3c872dcfc2a..993c7a8e807 100644 --- a/libavcodec/qsvdec_other.c +++ b/libavcodec/qsvdec_other.c @@ -138,8 +138,13 @@ static int qsv_decode_frame(AVCodecContext *avctx, void *data, } ret = ff_qsv_process_data(avctx, &s->qsv, frame, got_frame, &s->input_ref); - if (ret < 0) + if (ret < 0) { + /* Drop input packet when failed to decode the packet. Otherwise, + the decoder will keep decoding the failure packet. */ + av_packet_unref(&s->input_ref); + return ret; + } s->input_ref.size -= ret; s->input_ref.data += ret; @@ -159,7 +164,7 @@ static void qsv_decode_flush(AVCodecContext *avctx) #define OFFSET(x) offsetof(QSVOtherContext, x) #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM static const AVOption options[] = { - { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 0, INT_MAX, VD }, + { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VD }, { NULL }, };