summaryrefslogtreecommitdiff
path: root/libavcodec/svq1enc.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2023-01-24 00:35:54 +0100
committerMarton Balint <cus@passwd.hu>2023-02-13 00:36:46 +0100
commit6b6f7db81932f94876ff4bcfd2da0582b8ab897e (patch)
tree6aaa307f71042d91c6b19736f1cdc6498fd794e5 /libavcodec/svq1enc.c
parente506ea3ce1de0c782b2b833398240c8e19a02bb4 (diff)
avcodec: add AVCodecContext.frame_num as 64 bit variant to frame_number
Frame counters can overflow relatively easily (INT_MAX number of frames is slightly more than 1 year for 60 fps content), so make sure we use 64 bit values for them. Also deprecate the old 32 bit frame_number attribute. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavcodec/svq1enc.c')
-rw-r--r--libavcodec/svq1enc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c
index e3ea0c1e47..4651e01ae8 100644
--- a/libavcodec/svq1enc.c
+++ b/libavcodec/svq1enc.c
@@ -548,10 +548,10 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx)
SVQ1EncContext *const s = avctx->priv_data;
int i;
- if (avctx->frame_number)
+ if (avctx->frame_num)
av_log(avctx, AV_LOG_DEBUG, "RD: %f\n",
s->rd_total / (double)(avctx->width * avctx->height *
- avctx->frame_number));
+ avctx->frame_num));
s->m.mb_type = NULL;
ff_mpv_common_end(&s->m);
@@ -684,7 +684,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
FFSWAP(AVFrame*, s->current_picture, s->last_picture);
- if (avctx->gop_size && (avctx->frame_number % avctx->gop_size))
+ if (avctx->gop_size && (avctx->frame_num % avctx->gop_size))
s->pict_type = AV_PICTURE_TYPE_P;
else
s->pict_type = AV_PICTURE_TYPE_I;