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

@@ -266,7 +266,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
goto free_and_end;
}
avctx->frame_number = 0;
avctx->frame_num = 0;
#if FF_API_AVCTX_FRAME_NUMBER
FF_DISABLE_DEPRECATION_WARNINGS
avctx->frame_number = avctx->frame_num;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
avctx->codec_descriptor = avcodec_descriptor_get(avctx->codec_id);
if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) &&