summaryrefslogtreecommitdiff
path: root/doc
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 /doc
parente506ea3ce1de0c782b2b833398240c8e19a02bb4 (diff)
downloadffmpeg-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 'doc')
-rw-r--r--doc/APIchanges4
-rw-r--r--doc/examples/decode_video.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index 2c4723c669..f3ea960415 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
API changes, most recent first:
+2023-02-13 - xxxxxxxxxx - lavc 60.2.100 - avcodec.h
+ Add AVCodecContext.frame_num as a 64bit version of frame_number.
+ Deprecate AVCodecContext.frame_number.
+
2023-02-12 - xxxxxxxxxx - lavfi 9.1.100 - avfilter.h
Add filtergraph segment parsing API.
New structs:
diff --git a/doc/examples/decode_video.c b/doc/examples/decode_video.c
index 81ec4b50e2..b0b3a6ae92 100644
--- a/doc/examples/decode_video.c
+++ b/doc/examples/decode_video.c
@@ -70,12 +70,12 @@ static void decode(AVCodecContext *dec_ctx, AVFrame *frame, AVPacket *pkt,
exit(1);
}
- printf("saving frame %3d\n", dec_ctx->frame_number);
+ printf("saving frame %3"PRId64"\n", dec_ctx->frame_num);
fflush(stdout);
/* the picture is allocated by the decoder. no need to
free it */
- snprintf(buf, sizeof(buf), "%s-%d", filename, dec_ctx->frame_number);
+ snprintf(buf, sizeof(buf), "%s-%"PRId64, filename, dec_ctx->frame_num);
pgm_save(frame->data[0], frame->linesize[0],
frame->width, frame->height, buf);
}