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>
This commit is contained in:
Marton Balint
2023-01-24 00:35:54 +01:00
parent e506ea3ce1
commit 6b6f7db819
51 changed files with 146 additions and 96 deletions

View File

@@ -2115,7 +2115,7 @@ static int decode(InputStream *ist, AVCodecContext *avctx,
fd = (FrameData*)frame->opaque_ref->data;
fd->pts = frame->pts;
fd->tb = avctx->pkt_timebase;
fd->idx = avctx->frame_number - 1;
fd->idx = avctx->frame_num - 1;
}
*got_frame = 1;