diff options
author | Marton Balint <cus@passwd.hu> | 2023-01-24 00:35:54 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2023-02-13 00:36:46 +0100 |
commit | 6b6f7db81932f94876ff4bcfd2da0582b8ab897e (patch) | |
tree | 6aaa307f71042d91c6b19736f1cdc6498fd794e5 /libavcodec/4xm.c | |
parent | e506ea3ce1de0c782b2b833398240c8e19a02bb4 (diff) | |
download | ffmpeg-6b6f7db81932f94876ff4bcfd2da0582b8ab897e.tar.gz |
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/4xm.c')
-rw-r--r-- | libavcodec/4xm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 5636fdef2d..fab3fb5b77 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -875,7 +875,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, } for (i = 0; i < CFRAME_BUFFER_COUNT; i++) - if (f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number) + if (f->cfrm[i].id && f->cfrm[i].id < avctx->frame_num) av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", f->cfrm[i].id); @@ -910,9 +910,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, buf = cfrm->data; frame_size = cfrm->size; - if (id != avctx->frame_number) - av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n", - id, avctx->frame_number); + if (id != avctx->frame_num) + av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %"PRId64"\n", + id, avctx->frame_num); if (f->version <= 1) return AVERROR_INVALIDDATA; |