diff --git a/libavcodec/rkmppdec.c b/libavcodec/rkmppdec.c index 0e2e8577b3..3399ca3e75 100644 --- a/libavcodec/rkmppdec.c +++ b/libavcodec/rkmppdec.c @@ -148,7 +148,6 @@ static av_cold int rkmpp_decode_close(AVCodecContext *avctx) r->eof = 0; r->draining = 0; r->info_change = 0; - r->errinfo_cnt = 0; r->got_frame = 0; r->use_rfbc = 0; @@ -756,7 +755,7 @@ static int rkmpp_get_frame(AVCodecContext *avctx, AVFrame *frame, int timeout) } if (mpp_frame_get_errinfo(mpp_frame)) { av_log(avctx, AV_LOG_DEBUG, "Received a 'errinfo' frame\n"); - ret = (r->errinfo_cnt++ > MAX_ERRINFO_COUNT) ? AVERROR_EXTERNAL : AVERROR(EAGAIN); + ret = AVERROR(EAGAIN); goto exit; } @@ -829,7 +828,6 @@ static int rkmpp_get_frame(AVCodecContext *avctx, AVFrame *frame, int timeout) goto exit; } else { av_log(avctx, AV_LOG_DEBUG, "Received a frame\n"); - r->errinfo_cnt = 0; r->got_frame = 1; switch (avctx->pix_fmt) { @@ -1019,7 +1017,6 @@ static void rkmpp_decode_flush(AVCodecContext *avctx) r->eof = 0; r->draining = 0; r->info_change = 0; - r->errinfo_cnt = 0; r->got_frame = 0; av_packet_unref(&r->last_pkt); diff --git a/libavcodec/rkmppdec.h b/libavcodec/rkmppdec.h index d51a40cb96..704cad8e93 100644 --- a/libavcodec/rkmppdec.h +++ b/libavcodec/rkmppdec.h @@ -41,7 +41,6 @@ #include "libavutil/opt.h" #include "libavutil/pixdesc.h" -#define MAX_ERRINFO_COUNT 100 #define MAX_SOC_NAME_LENGTH 128 typedef struct RKMPPDecContext { @@ -58,7 +57,6 @@ typedef struct RKMPPDecContext { int eof; int draining; int info_change; - int errinfo_cnt; int got_frame; int use_rfbc;