fixup! lavc/rkmppdec: refactor RKMPP decoders and extend codecs

remove MAX_ERRINFO_COUNT.

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
This commit is contained in:
nyanmisaka
2025-02-07 00:22:02 +08:00
parent 4b0e666711
commit ea9247abf4
2 changed files with 1 additions and 6 deletions

View File

@@ -148,7 +148,6 @@ static av_cold int rkmpp_decode_close(AVCodecContext *avctx)
r->eof = 0; r->eof = 0;
r->draining = 0; r->draining = 0;
r->info_change = 0; r->info_change = 0;
r->errinfo_cnt = 0;
r->got_frame = 0; r->got_frame = 0;
r->use_rfbc = 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)) { if (mpp_frame_get_errinfo(mpp_frame)) {
av_log(avctx, AV_LOG_DEBUG, "Received a 'errinfo' frame\n"); 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; goto exit;
} }
@@ -829,7 +828,6 @@ static int rkmpp_get_frame(AVCodecContext *avctx, AVFrame *frame, int timeout)
goto exit; goto exit;
} else { } else {
av_log(avctx, AV_LOG_DEBUG, "Received a frame\n"); av_log(avctx, AV_LOG_DEBUG, "Received a frame\n");
r->errinfo_cnt = 0;
r->got_frame = 1; r->got_frame = 1;
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
@@ -1019,7 +1017,6 @@ static void rkmpp_decode_flush(AVCodecContext *avctx)
r->eof = 0; r->eof = 0;
r->draining = 0; r->draining = 0;
r->info_change = 0; r->info_change = 0;
r->errinfo_cnt = 0;
r->got_frame = 0; r->got_frame = 0;
av_packet_unref(&r->last_pkt); av_packet_unref(&r->last_pkt);

View File

@@ -41,7 +41,6 @@
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#define MAX_ERRINFO_COUNT 100
#define MAX_SOC_NAME_LENGTH 128 #define MAX_SOC_NAME_LENGTH 128
typedef struct RKMPPDecContext { typedef struct RKMPPDecContext {
@@ -58,7 +57,6 @@ typedef struct RKMPPDecContext {
int eof; int eof;
int draining; int draining;
int info_change; int info_change;
int errinfo_cnt;
int got_frame; int got_frame;
int use_rfbc; int use_rfbc;