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:
parent
e506ea3ce1
commit
6b6f7db819
51 changed files with 146 additions and 96 deletions
|
|
@ -171,7 +171,12 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
|
|||
}
|
||||
|
||||
ret = ffcodec(avctx->codec)->cb.encode_sub(avctx, buf, buf_size, sub);
|
||||
avctx->frame_number++;
|
||||
avctx->frame_num++;
|
||||
#if FF_API_AVCTX_FRAME_NUMBER
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
avctx->frame_number = avctx->frame_num;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -503,7 +508,12 @@ int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame
|
|||
return ret;
|
||||
}
|
||||
|
||||
avctx->frame_number++;
|
||||
avctx->frame_num++;
|
||||
#if FF_API_AVCTX_FRAME_NUMBER
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
avctx->frame_number = avctx->frame_num;
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue