History

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.

Marton Balint committed 3 years ago

Commit 6b6f7db1 parent e506ea351 files · +146 −96Browse files

Unified · Split

51 files
  1. doc/APIchanges +4 −0
  2. doc/examples/decode_video.c +2 −2
  3. fftools/ffmpeg.c +1 −1
  4. libavcodec/4xm.c +4 −4
  5. libavcodec/8svx.c +1 −1
  6. libavcodec/aacenc.c +2 −2
  7. libavcodec/ansi.c +1 −1
  8. libavcodec/atrac3plus.c +2 −2
  9. libavcodec/avcodec.c +6 −1
  10. libavcodec/avcodec.h +15 −0
  11. libavcodec/bfi.c +1 −1
  12. libavcodec/cdgraphics.c +1 −1
  13. libavcodec/cljrenc.c +1 −1
  14. libavcodec/decode.c +16 −6
  15. libavcodec/dvenc.c +1 −1
  16. libavcodec/eac3enc.c +1 −1
  17. libavcodec/encode.c +12 −2
  18. libavcodec/evrcdec.c +2 −2
  19. libavcodec/flashsv2enc.c +8 −8
  20. libavcodec/flashsvenc.c +4 −4
  21. libavcodec/g2meet.c +2 −2
  22. libavcodec/gif.c +2 −2
  23. libavcodec/h261dec.c +1 −1
  24. libavcodec/h264_slice.c +1 −1
  25. libavcodec/interplayvideo.c +4 −4
  26. libavcodec/ituh263dec.c +1 −1
  27. libavcodec/libwebpenc_animencoder.c +1 −1
  28. libavcodec/mjpegdec.c +1 −1
  29. libavcodec/mlpenc.c +3 −3
  30. libavcodec/mpegutils.c +1 −1
  31. libavcodec/nuv.c +1 −1
  32. libavcodec/options_table.h +1 −1
  33. libavcodec/opusenc.c +1 −1
  34. libavcodec/pngenc.c +4 −4
  35. libavcodec/pthread_frame.c +5 −0
  36. libavcodec/qcelpdec.c +2 −2
  37. libavcodec/qtrleenc.c +1 −1
  38. libavcodec/rv10.c +1 −1
  39. libavcodec/smcenc.c +1 −1
  40. libavcodec/snowenc.c +6 −6
  41. libavcodec/svq1enc.c +3 −3
  42. libavcodec/svq3.c +2 −2
  43. libavcodec/version.h +1 −1
  44. libavcodec/version_major.h +1 −0
  45. libavcodec/vp3.c +3 −3
  46. libavcodec/wcmv.c +1 −1
  47. libavcodec/wmaprodec.c +3 −3
  48. libavcodec/yop.c +1 −1
  49. tools/decode_simple.c +3 −3
  50. tools/scale_slice_test.c +2 −2
  51. tools/venc_data_dump.c +1 −1
doc/APIchanges+4−0
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09 · 1 unmodified line
22
33 API changes, most recent first:
44
5+2023-02-13 - xxxxxxxxxx - lavc 60.2.100 - avcodec.h
6+ Add AVCodecContext.frame_num as a 64bit version of frame_number.
7+ Deprecate AVCodecContext.frame_number.
8+
59 2023-02-12 - xxxxxxxxxx - lavfi 9.1.100 - avfilter.h
610 Add filtergraph segment parsing API.
711 New structs:
doc/examples/decode_video.c+2−2
@@ -70,12 +70,12 @@ static void decode(AVCodecContext *dec_ctx, AVFrame *frame, AVPacket *pkt, · 69 unmodified lines
7070 exit(1);
7171 }
7272
73− printf("saving frame %3d\n", dec_ctx->frame_number);
73+ printf("saving frame %3"PRId64"\n", dec_ctx->frame_num);
7474 fflush(stdout);
7575
7676 /* the picture is allocated by the decoder. no need to
7777 free it */
78− snprintf(buf, sizeof(buf), "%s-%d", filename, dec_ctx->frame_number);
78+ snprintf(buf, sizeof(buf), "%s-%"PRId64, filename, dec_ctx->frame_num);
7979 pgm_save(frame->data[0], frame->linesize[0],
8080 frame->width, frame->height, buf);
8181 }
fftools/ffmpeg.c+1−1
@@ -2115,7 +2115,7 @@ static int decode(InputStream *ist, AVCodecContext *avctx, · 2114 unmodified lines
21152115 fd = (FrameData*)frame->opaque_ref->data;
21162116 fd->pts = frame->pts;
21172117 fd->tb = avctx->pkt_timebase;
2118− fd->idx = avctx->frame_number - 1;
2118+ fd->idx = avctx->frame_num - 1;
21192119 }
21202120
21212121 *got_frame = 1;
libavcodec/4xm.c+4−4
@@ -875,7 +875,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, · 874 unmodified lines
875875 }
876876
877877 for (i = 0; i < CFRAME_BUFFER_COUNT; i++)
878− if (f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
878+ if (f->cfrm[i].id && f->cfrm[i].id < avctx->frame_num)
879879 av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n",
880880 f->cfrm[i].id);
881881
@@ -910,9 +910,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, · 28 unmodified lines
910910 buf = cfrm->data;
911911 frame_size = cfrm->size;
912912
913− if (id != avctx->frame_number)
914− av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %d\n",
915− id, avctx->frame_number);
913+ if (id != avctx->frame_num)
914+ av_log(f->avctx, AV_LOG_ERROR, "cframe id mismatch %d %"PRId64"\n",
915+ id, avctx->frame_num);
916916
917917 if (f->version <= 1)
918918 return AVERROR_INVALIDDATA;
libavcodec/8svx.c+1−1
@@ -151,7 +151,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 150 unmodified lines
151151
152152 *got_frame_ptr = 1;
153153
154− return ((avctx->frame_number == 0) * hdr_size + buf_size) * channels;
154+ return ((avctx->frame_num == 0) * hdr_size + buf_size) * channels;
155155 }
156156
157157 static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
libavcodec/aacenc.c+2−2
@@ -854,7 +854,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 853 unmodified lines
854854 if (s->psypp)
855855 ff_psy_preprocess(s->psypp, s->planar_samples, s->channels);
856856
857− if (!avctx->frame_number)
857+ if (!avctx->frame_num)
858858 return 0;
859859
860860 start_ch = 0;
@@ -958,7 +958,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 97 unmodified lines
958958 do {
959959 init_put_bits(&s->pb, avpkt->data, avpkt->size);
960960
961− if ((avctx->frame_number & 0xFF)==1 && !(avctx->flags & AV_CODEC_FLAG_BITEXACT))
961+ if ((avctx->frame_num & 0xFF)==1 && !(avctx->flags & AV_CODEC_FLAG_BITEXACT))
962962 put_bitstream_info(s, LIBAVCODEC_IDENT);
963963 start_ch = 0;
964964 target_bits = 0;
libavcodec/ansi.c+1−1
@@ -364,7 +364,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 363 unmodified lines
364364
365365 if ((ret = ff_reget_buffer(avctx, s->frame, 0)) < 0)
366366 return ret;
367− if (!avctx->frame_number) {
367+ if (!avctx->frame_num) {
368368 for (i=0; i<avctx->height; i++)
369369 memset(s->frame->data[0]+ i*s->frame->linesize[0], 0, avctx->width);
370370 memset(s->frame->data[1], 0, AVPALETTE_SIZE);
libavcodec/atrac3plus.c+2−2
@@ -1391,9 +1391,9 @@ static int decode_band_numwavs(GetBitContext *gb, Atrac3pChanUnitCtx *ctx, · 1390 unmodified lines
13911391 if (band_has_tones[sb]) {
13921392 if (ctx->waves_info->tones_index + dst[sb].num_wavs > 48) {
13931393 av_log(avctx, AV_LOG_ERROR,
1394− "Too many tones: %d (max. 48), frame: %d!\n",
1394+ "Too many tones: %d (max. 48), frame: %"PRId64"!\n",
13951395 ctx->waves_info->tones_index + dst[sb].num_wavs,
1396− avctx->frame_number);
1396+ avctx->frame_num);
13971397 return AVERROR_INVALIDDATA;
13981398 }
13991399 dst[sb].start_index = ctx->waves_info->tones_index;
libavcodec/avcodec.c+6−1
@@ -266,7 +266,12 @@ FF_ENABLE_DEPRECATION_WARNINGS · 265 unmodified lines
266266 goto free_and_end;
267267 }
268268
269− avctx->frame_number = 0;
269+ avctx->frame_num = 0;
270+#if FF_API_AVCTX_FRAME_NUMBER
271+FF_DISABLE_DEPRECATION_WARNINGS
272+ avctx->frame_number = avctx->frame_num;
273+FF_ENABLE_DEPRECATION_WARNINGS
274+#endif
270275 avctx->codec_descriptor = avcodec_descriptor_get(avctx->codec_id);
271276
272277 if ((avctx->codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) &&
libavcodec/avcodec.h+15−0
@@ -1061,6 +1061,7 @@ typedef struct AVCodecContext { · 1060 unmodified lines
10611061 */
10621062 int frame_size;
10631063
1064+#if FF_API_AVCTX_FRAME_NUMBER
10641065 /**
10651066 * Frame counter, set by libavcodec.
10661067 *
@@ -1069,8 +1070,11 @@ typedef struct AVCodecContext { · 2 unmodified lines
10691070 *
10701071 * @note the counter is not incremented if encoding/decoding resulted in
10711072 * an error.
1073+ * @deprecated use frame_num instead
10721074 */
1075+ attribute_deprecated
10731076 int frame_number;
1077+#endif
10741078
10751079 /**
10761080 * number of bytes per packet if constant and known or 0
@@ -2048,6 +2052,17 @@ typedef struct AVCodecContext { · 971 unmodified lines
20482052 * The decoder can then override during decoding as needed.
20492053 */
20502054 AVChannelLayout ch_layout;
2055+
2056+ /**
2057+ * Frame counter, set by libavcodec.
2058+ *
2059+ * - decoding: total number of frames returned from the decoder so far.
2060+ * - encoding: total number of frames passed to the encoder so far.
2061+ *
2062+ * @note the counter is not incremented if encoding/decoding resulted in
2063+ * an error.
2064+ */
2065+ int64_t frame_num;
20512066 } AVCodecContext;
20522067
20532068 /**
libavcodec/bfi.c+1−1
@@ -66,7 +66,7 @@ static int bfi_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 65 unmodified lines
6666 bytestream2_init(&g, avpkt->data, buf_size);
6767
6868 /* Set frame parameters and palette, if necessary */
69− if (!avctx->frame_number) {
69+ if (!avctx->frame_num) {
7070 frame->pict_type = AV_PICTURE_TYPE_I;
7171 frame->key_frame = 1;
7272 /* Setting the palette */
libavcodec/cdgraphics.c+1−1
@@ -374,7 +374,7 @@ static void cdg_decode_flush(AVCodecContext *avctx) · 373 unmodified lines
374374 return;
375375
376376 memset(cc->frame->data[0], 0, cc->frame->linesize[0] * avctx->height);
377− if (!avctx->frame_number)
377+ if (!avctx->frame_num)
378378 memset(cc->frame->data[1], 0, AVPALETTE_SIZE);
379379 }
380380
libavcodec/cljrenc.c+1−1
@@ -42,7 +42,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 41 unmodified lines
4242 CLJRContext *a = avctx->priv_data;
4343 PutBitContext pb;
4444 int x, y, ret;
45− uint32_t dither= avctx->frame_number;
45+ uint32_t dither= avctx->frame_num;
4646 static const uint32_t ordered_dither[2][2] =
4747 {
4848 { 0x10400000, 0x104F0000 },
libavcodec/decode.c+16−6
@@ -711,11 +711,16 @@ int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame) · 710 unmodified lines
711711 goto fail;
712712 }
713713
714− avctx->frame_number++;
714+ avctx->frame_num++;
715+#if FF_API_AVCTX_FRAME_NUMBER
716+FF_DISABLE_DEPRECATION_WARNINGS
717+ avctx->frame_number = avctx->frame_num;
718+FF_ENABLE_DEPRECATION_WARNINGS
719+#endif
715720
716721 if (avctx->flags & AV_CODEC_FLAG_DROPCHANGED) {
717722
718− if (avctx->frame_number == 1) {
723+ if (avctx->frame_num == 1) {
719724 avci->initial_format = frame->format;
720725 switch(avctx->codec_type) {
721726 case AVMEDIA_TYPE_VIDEO:
@@ -732,7 +737,7 @@ int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame) · 10 unmodified lines
732737 }
733738 }
734739
735− if (avctx->frame_number > 1) {
740+ if (avctx->frame_num > 1) {
736741 changed = avci->initial_format != frame->format;
737742
738743 switch(avctx->codec_type) {
@@ -749,9 +754,9 @@ int ff_decode_receive_frame(AVCodecContext *avctx, AVFrame *frame) · 10 unmodified lines
749754
750755 if (changed) {
751756 avci->changed_frames_dropped++;
752− av_log(avctx, AV_LOG_INFO, "dropped changed frame #%d pts %"PRId64
757+ av_log(avctx, AV_LOG_INFO, "dropped changed frame #%"PRId64" pts %"PRId64
753758 " drop count: %d \n",
754− avctx->frame_number, frame->pts,
759+ avctx->frame_num, frame->pts,
755760 avci->changed_frames_dropped);
756761 ret = AVERROR_INPUT_CHANGED;
757762 goto fail;
@@ -916,7 +921,12 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, · 158 unmodified lines
916921 }
917922
918923 if (*got_sub_ptr)
919− avctx->frame_number++;
924+ avctx->frame_num++;
925+#if FF_API_AVCTX_FRAME_NUMBER
926+FF_DISABLE_DEPRECATION_WARNINGS
927+ avctx->frame_number = avctx->frame_num;
928+FF_ENABLE_DEPRECATION_WARNINGS
929+#endif
920930 }
921931
922932 return ret;
libavcodec/dvenc.c+1−1
@@ -1144,7 +1144,7 @@ static void dv_format_frame(DVEncContext *c, uint8_t *buf) · 1143 unmodified lines
11441144 {
11451145 int chan, i, j, k;
11461146 /* We work with 720p frames split in half. The odd half-frame is chan 2,3 */
1147− int chan_offset = 2*(c->sys->height == 720 && c->avctx->frame_number & 1);
1147+ int chan_offset = 2*(c->sys->height == 720 && c->avctx->frame_num & 1);
11481148
11491149 for (chan = 0; chan < c->sys->n_difchan; chan++) {
11501150 for (i = 0; i < c->sys->difseg_size; i++) {
libavcodec/eac3enc.c+1−1
@@ -189,7 +189,7 @@ void ff_eac3_output_frame_header(AC3EncodeContext *s) · 188 unmodified lines
189189 put_bits(&s->pb, 1, 0);
190190 }
191191 if (s->num_blocks != 6)
192− put_bits(&s->pb, 1, !(s->avctx->frame_number % 6)); /* converter sync flag */
192+ put_bits(&s->pb, 1, !(s->avctx->frame_num % 6)); /* converter sync flag */
193193 put_bits(&s->pb, 1, 0); /* no additional bit stream info */
194194
195195 /* frame header */
libavcodec/encode.c+12−2
@@ -171,7 +171,12 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, · 170 unmodified lines
171171 }
172172
173173 ret = ffcodec(avctx->codec)->cb.encode_sub(avctx, buf, buf_size, sub);
174− avctx->frame_number++;
174+ avctx->frame_num++;
175+#if FF_API_AVCTX_FRAME_NUMBER
176+FF_DISABLE_DEPRECATION_WARNINGS
177+ avctx->frame_number = avctx->frame_num;
178+FF_ENABLE_DEPRECATION_WARNINGS
179+#endif
175180 return ret;
176181 }
177182
@@ -503,7 +508,12 @@ int attribute_align_arg avcodec_send_frame(AVCodecContext *avctx, const AVFrame · 325 unmodified lines
503508 return ret;
504509 }
505510
506− avctx->frame_number++;
511+ avctx->frame_num++;
512+#if FF_API_AVCTX_FRAME_NUMBER
513+FF_DISABLE_DEPRECATION_WARNINGS
514+ avctx->frame_number = avctx->frame_num;
515+FF_ENABLE_DEPRECATION_WARNINGS
516+#endif
507517
508518 return 0;
509519 }
libavcodec/evrcdec.c+2−2
@@ -221,8 +221,8 @@ static evrc_packet_rate determine_bitrate(AVCodecContext *avctx, · 220 unmodified lines
221221 static void warn_insufficient_frame_quality(AVCodecContext *avctx,
222222 const char *message)
223223 {
224− av_log(avctx, AV_LOG_WARNING, "Frame #%d, %s\n",
225− avctx->frame_number, message);
224+ av_log(avctx, AV_LOG_WARNING, "Frame #%"PRId64", %s\n",
225+ avctx->frame_num, message);
226226 }
227227
228228 /**
libavcodec/flashsv2enc.c+8−8
@@ -105,7 +105,7 @@ typedef struct FlashSV2Context { · 104 unmodified lines
105105
106106 int rows, cols;
107107
108− int last_key_frame;
108+ int64_t last_key_frame;
109109
110110 int image_width, image_height;
111111 int block_width, block_height;
@@ -787,7 +787,7 @@ static int optimum_use15_7(FlashSV2Context * s) · 675 unmodified lines
787787 {
788788 #ifndef FLASHSV2_DUMB
789789 double ideal = ((double)(s->avctx->bit_rate * s->avctx->time_base.den * s->avctx->ticks_per_frame)) /
790− ((double) s->avctx->time_base.num) * s->avctx->frame_number;
790+ ((double) s->avctx->time_base.num) * s->avctx->frame_num;
791791 if (ideal + use15_7_threshold < s->total_bits) {
792792 return 1;
793793 } else {
@@ -861,20 +861,20 @@ static int flashsv2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 67 unmodified lines
861861 return res;
862862
863863 /* First frame needs to be a keyframe */
864− if (avctx->frame_number == 0)
864+ if (avctx->frame_num == 0)
865865 keyframe = 1;
866866
867867 /* Check the placement of keyframes */
868868 if (avctx->gop_size > 0) {
869− if (avctx->frame_number >= s->last_key_frame + avctx->gop_size)
869+ if (avctx->frame_num >= s->last_key_frame + avctx->gop_size)
870870 keyframe = 1;
871871 }
872872
873873 if (!keyframe
874− && avctx->frame_number > s->last_key_frame + avctx->keyint_min) {
874+ && avctx->frame_num > s->last_key_frame + avctx->keyint_min) {
875875 recommend_keyframe(s, &keyframe);
876876 if (keyframe)
877− av_log(avctx, AV_LOG_DEBUG, "Recommending key frame at frame %d\n", avctx->frame_number);
877+ av_log(avctx, AV_LOG_DEBUG, "Recommending key frame at frame %"PRId64"\n", avctx->frame_num);
878878 }
879879
880880 if (keyframe) {
@@ -890,9 +890,9 @@ static int flashsv2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 9 unmodified lines
890890
891891 if (keyframe) {
892892 new_key_frame(s);
893− s->last_key_frame = avctx->frame_number;
893+ s->last_key_frame = avctx->frame_num;
894894 pkt->flags |= AV_PKT_FLAG_KEY;
895− av_log(avctx, AV_LOG_DEBUG, "Inserting key frame at frame %d\n", avctx->frame_number);
895+ av_log(avctx, AV_LOG_DEBUG, "Inserting key frame at frame %"PRId64"\n", avctx->frame_num);
896896 }
897897
898898 pkt->size = res;
libavcodec/flashsvenc.c+4−4
@@ -65,7 +65,7 @@ typedef struct FlashSVContext { · 64 unmodified lines
6565 AVBufferRef *prev_frame_buf;
6666 int image_width, image_height;
6767 unsigned packet_size;
68− int last_key_frame;
68+ int64_t last_key_frame;
6969 uint8_t tmpblock[3 * 256 * 256];
7070 } FlashSVContext;
7171
@@ -215,7 +215,7 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 143 unmodified lines
215215
216216 /* Check the placement of keyframes */
217217 if (avctx->gop_size > 0 &&
218− avctx->frame_number >= s->last_key_frame + avctx->gop_size) {
218+ avctx->frame_num >= s->last_key_frame + avctx->gop_size) {
219219 I_frame = 1;
220220 }
221221
@@ -229,8 +229,8 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 7 unmodified lines
229229
230230 //mark the frame type so the muxer can mux it correctly
231231 if (I_frame) {
232− s->last_key_frame = avctx->frame_number;
233− ff_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);
232+ s->last_key_frame = avctx->frame_num;
233+ ff_dlog(avctx, "Inserting keyframe at frame %"PRId64"\n", avctx->frame_num);
234234 }
235235
236236 if (I_frame)
libavcodec/g2meet.c+2−2
@@ -931,8 +931,8 @@ static int epic_jb_decode_tile(G2MContext *c, int tile_x, int tile_y, · 930 unmodified lines
931931
932932 if (ret) {
933933 av_log(avctx, AV_LOG_ERROR,
934− "ePIC: tile decoding failed, frame=%d, tile_x=%d, tile_y=%d\n",
935− avctx->frame_number, tile_x, tile_y);
934+ "ePIC: tile decoding failed, frame=%"PRId64", tile_x=%d, tile_y=%d\n",
935+ avctx->frame_num, tile_x, tile_y);
936936 return AVERROR_INVALIDDATA;
937937 }
938938
libavcodec/gif.c+2−2
@@ -318,7 +318,7 @@ static int gif_image_write_image(AVCodecContext *avctx, · 317 unmodified lines
318318 disposal = GCE_DISPOSAL_INPLACE;
319319 }
320320
321− if (s->image || !avctx->frame_number) { /* GIF header */
321+ if (s->image || !avctx->frame_num) { /* GIF header */
322322 const uint32_t *global_palette = palette ? palette : s->palette;
323323 const AVRational sar = avctx->sample_aspect_ratio;
324324 int64_t aspect = 0;
@@ -510,7 +510,7 @@ static int gif_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 185 unmodified lines
510510 }
511511
512512 pkt->size = outbuf_ptr - pkt->data;
513− if (s->image || !avctx->frame_number)
513+ if (s->image || !avctx->frame_num)
514514 pkt->flags |= AV_PKT_FLAG_KEY;
515515 *got_packet = 1;
516516
libavcodec/h261dec.c+1−1
@@ -610,7 +610,7 @@ static int h261_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 609 unmodified lines
610610 MpegEncContext *s = &h->s;
611611 int ret;
612612
613− ff_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
613+ ff_dlog(avctx, "*****frame %"PRId64" size=%d\n", avctx->frame_num, buf_size);
614614 ff_dlog(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
615615
616616 h->gob_start_code_skipped = 0;
libavcodec/h264_slice.c+1−1
@@ -1297,7 +1297,7 @@ static int h264_select_output_frame(H264Context *h) · 1296 unmodified lines
12971297 h->last_pocs[0] = cur->poc;
12981298 cur->mmco_reset = 1;
12991299 } else if(h->avctx->has_b_frames < out_of_order && !sps->bitstream_restriction_flag){
1300− int loglevel = h->avctx->frame_number > 1 ? AV_LOG_WARNING : AV_LOG_VERBOSE;
1300+ int loglevel = h->avctx->frame_num > 1 ? AV_LOG_WARNING : AV_LOG_VERBOSE;
13011301 av_log(h->avctx, loglevel, "Increasing reorder buffer to %d\n", out_of_order);
13021302 h->avctx->has_b_frames = out_of_order;
13031303 }
libavcodec/interplayvideo.c+4−4
@@ -926,7 +926,7 @@ static void ipvideo_format_06_firstpass(IpvideoContext *s, AVFrame *frame, int16 · 925 unmodified lines
926926 }
927927 } else {
928928 /* Don't try to copy second_last_frame data on the first frames */
929− if (s->avctx->frame_number > 2)
929+ if (s->avctx->frame_num > 2)
930930 copy_from(s, s->second_last_frame, frame, 0, 0);
931931 }
932932 }
@@ -1085,7 +1085,7 @@ static void ipvideo_decode_format_10_opcodes(IpvideoContext *s, AVFrame *frame) · 152 unmodified lines
10851085 copy_from(s, s->cur_decode_frame, frame, 0, 0);
10861086 } else {
10871087 /* Don't try to copy last_frame data on the first frame */
1088− if (s->avctx->frame_number)
1088+ if (s->avctx->frame_num)
10891089 copy_from(s, s->last_frame, frame, 0, 0);
10901090 }
10911091 skip *= 2;
@@ -1144,8 +1144,8 @@ static void ipvideo_decode_format_11_opcodes(IpvideoContext *s, AVFrame *frame) · 52 unmodified lines
11441144 ret = ipvideo_decode_block16[opcode](s, frame);
11451145 }
11461146 if (ret != 0) {
1147− av_log(s->avctx, AV_LOG_ERROR, "decode problem on frame %d, @ block (%d, %d)\n",
1148− s->avctx->frame_number, x, y);
1147+ av_log(s->avctx, AV_LOG_ERROR, "decode problem on frame %"PRId64", @ block (%d, %d)\n",
1148+ s->avctx->frame_num, x, y);
11491149 return;
11501150 }
11511151 }
libavcodec/ituh263dec.c+1−1
@@ -1093,7 +1093,7 @@ int ff_h263_decode_picture_header(MpegEncContext *s) · 1092 unmodified lines
10931093
10941094 align_get_bits(&s->gb);
10951095
1096− if (show_bits(&s->gb, 2) == 2 && s->avctx->frame_number == 0) {
1096+ if (show_bits(&s->gb, 2) == 2 && s->avctx->frame_num == 0) {
10971097 av_log(s->avctx, AV_LOG_WARNING, "Header looks like RTP instead of H.263\n");
10981098 }
10991099
libavcodec/libwebpenc_animencoder.c+1−1
@@ -132,7 +132,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 131 unmodified lines
132132 goto end;
133133 }
134134
135− if (!avctx->frame_number) {
135+ if (!avctx->frame_num) {
136136 s->first_frame_pts = frame->pts;
137137 #if FF_API_REORDERED_OPAQUE
138138 FF_DISABLE_DEPRECATION_WARNINGS
libavcodec/mjpegdec.c+1−1
@@ -2884,7 +2884,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) · 2883 unmodified lines
28842884 MJpegDecodeContext *s = avctx->priv_data;
28852885 int i, j;
28862886
2887− if (s->interlaced && s->bottom_field == !s->interlace_polarity && s->got_picture && !avctx->frame_number) {
2887+ if (s->interlaced && s->bottom_field == !s->interlace_polarity && s->got_picture && !avctx->frame_num) {
28882888 av_log(avctx, AV_LOG_INFO, "Single field\n");
28892889 }
28902890
libavcodec/mlpenc.c+3−3
@@ -2118,7 +2118,7 @@ static int mlp_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 2117 unmodified lines
21182118
21192119 data = frame ? frame->data[0] : NULL;
21202120
2121− ctx->frame_index = avctx->frame_number % ctx->max_restart_interval;
2121+ ctx->frame_index = avctx->frame_num % ctx->max_restart_interval;
21222122
21232123 ctx->inout_buffer = ctx->major_inout_buffer
21242124 + ctx->frame_index * ctx->one_sample_buffer_size;
@@ -2128,7 +2128,7 @@ static int mlp_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 3 unmodified lines
21282128
21292129 ctx->write_buffer = ctx->inout_buffer;
21302130
2131− if (avctx->frame_number < ctx->max_restart_interval) {
2131+ if (avctx->frame_num < ctx->max_restart_interval) {
21322132 if (data)
21332133 goto input_and_return;
21342134 }
@@ -2199,7 +2199,7 @@ input_and_return: · 64 unmodified lines
21992199 }
22002200
22012201 if (!frame && ctx->last_frames < ctx->max_restart_interval - 1)
2202− avctx->frame_number++;
2202+ avctx->frame_num++;
22032203
22042204 if (bytes_written > 0) {
22052205 ff_af_queue_remove(&ctx->afq,
libavcodec/mpegutils.c+1−1
@@ -230,7 +230,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, · 229 unmodified lines
230230 if (mbcount) {
231231 AVFrameSideData *sd;
232232
233− av_log(avctx, AV_LOG_DEBUG, "Adding %d MVs info to frame %d\n", mbcount, avctx->frame_number);
233+ av_log(avctx, AV_LOG_DEBUG, "Adding %d MVs info to frame %"PRId64"\n", mbcount, avctx->frame_num);
234234 sd = av_frame_new_side_data(pict, AV_FRAME_DATA_MOTION_VECTORS, mbcount * sizeof(AVMotionVector));
235235 if (!sd) {
236236 av_freep(&mvs);
libavcodec/nuv.c+1−1
@@ -139,7 +139,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture, · 138 unmodified lines
139139 int size_change = 0;
140140 int minsize = 0;
141141 int flags = 0;
142− int result, init_frame = !avctx->frame_number;
142+ int result, init_frame = !avctx->frame_num;
143143 enum {
144144 NUV_UNCOMPRESSED = '0',
145145 NUV_RTJPEG = '1',
libavcodec/options_table.h+1−1
@@ -97,7 +97,7 @@ static const AVOption avcodec_options[] = { · 96 unmodified lines
9797 #endif
9898 {"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E},
9999 {"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|E},
100−{"frame_number", NULL, OFFSET(frame_number), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
100+{"frame_number", NULL, OFFSET(frame_num), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
101101 {"delay", NULL, OFFSET(delay), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX},
102102 {"qcomp", "video quantizer scale compression (VBR). Constant of ratecontrol equation. "
103103 "Recommended range for default rc_eq: 0.0-1.0",
libavcodec/opusenc.c+1−1
@@ -554,7 +554,7 @@ static int opus_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 553 unmodified lines
554554 ff_bufqueue_add(avctx, &s->bufqueue, av_frame_clone(frame));
555555 } else {
556556 ff_opus_psy_signal_eof(&s->psyctx);
557− if (!s->afq.remaining_samples || !avctx->frame_number)
557+ if (!s->afq.remaining_samples || !avctx->frame_num)
558558 return 0; /* We've been flushed and there's nothing left to encode */
559559 }
560560
libavcodec/pngenc.c+4−4
@@ -251,7 +251,7 @@ static void png_write_image_data(AVCodecContext *avctx, · 250 unmodified lines
251251 const AVCRC *crc_table = av_crc_get_table(AV_CRC_32_IEEE_LE);
252252 uint32_t crc = ~0U;
253253
254− if (avctx->codec_id == AV_CODEC_ID_PNG || avctx->frame_number == 0) {
254+ if (avctx->codec_id == AV_CODEC_ID_PNG || avctx->frame_num == 0) {
255255 png_write_chunk(&s->bytestream, MKTAG('I', 'D', 'A', 'T'), buf, length);
256256 return;
257257 }
@@ -799,7 +799,7 @@ static int apng_encode_frame(AVCodecContext *avctx, const AVFrame *pict, · 541 unmodified lines
799799 APNGFctlChunk last_fctl_chunk = *best_last_fctl_chunk;
800800 APNGFctlChunk fctl_chunk = *best_fctl_chunk;
801801
802− if (avctx->frame_number == 0) {
802+ if (avctx->frame_num == 0) {
803803 best_fctl_chunk->width = pict->width;
804804 best_fctl_chunk->height = pict->height;
805805 best_fctl_chunk->x_offset = 0;
@@ -924,7 +924,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt, · 118 unmodified lines
924924 if (pict && s->color_type == PNG_COLOR_TYPE_PALETTE) {
925925 uint32_t checksum = ~av_crc(av_crc_get_table(AV_CRC_32_IEEE_LE), ~0U, pict->data[1], 256 * sizeof(uint32_t));
926926
927− if (avctx->frame_number == 0) {
927+ if (avctx->frame_num == 0) {
928928 s->palette_checksum = checksum;
929929 } else if (checksum != s->palette_checksum) {
930930 av_log(avctx, AV_LOG_ERROR,
@@ -946,7 +946,7 @@ static int encode_apng(AVCodecContext *avctx, AVPacket *pkt, · 15 unmodified lines
946946 if (max_packet_size > INT_MAX)
947947 return AVERROR(ENOMEM);
948948
949− if (avctx->frame_number == 0) {
949+ if (avctx->frame_num == 0) {
950950 if (!pict)
951951 return AVERROR(EINVAL);
952952
libavcodec/pthread_frame.c+5−0
@@ -362,7 +362,12 @@ static int update_context_from_user(AVCodecContext *dst, AVCodecContext *src) · 361 unmodified lines
362362 dst->skip_idct = src->skip_idct;
363363 dst->skip_frame = src->skip_frame;
364364
365+ dst->frame_num = src->frame_num;
366+#if FF_API_AVCTX_FRAME_NUMBER
367+FF_DISABLE_DEPRECATION_WARNINGS
365368 dst->frame_number = src->frame_number;
369+FF_ENABLE_DEPRECATION_WARNINGS
370+#endif
366371 #if FF_API_REORDERED_OPAQUE
367372 FF_DISABLE_DEPRECATION_WARNINGS
368373 dst->reordered_opaque = src->reordered_opaque;
libavcodec/qcelpdec.c+2−2
@@ -646,8 +646,8 @@ static qcelp_packet_rate determine_bitrate(AVCodecContext *avctx, · 645 unmodified lines
646646 static void warn_insufficient_frame_quality(AVCodecContext *avctx,
647647 const char *message)
648648 {
649− av_log(avctx, AV_LOG_WARNING, "Frame #%d, IFQ: %s\n",
650− avctx->frame_number, message);
649+ av_log(avctx, AV_LOG_WARNING, "Frame #%"PRId64", IFQ: %s\n",
650+ avctx->frame_num, message);
651651 }
652652
653653 static void postfilter(QCELPContext *q, float *samples, float *lpc)
libavcodec/qtrleenc.c+1−1
@@ -374,7 +374,7 @@ static int qtrle_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 373 unmodified lines
374374 return ret;
375375
376376 if (avctx->gop_size == 0 || !s->previous_frame->data[0] ||
377− (s->avctx->frame_number % avctx->gop_size) == 0) {
377+ (s->avctx->frame_num % avctx->gop_size) == 0) {
378378 /* I-Frame */
379379 s->key_frame = 1;
380380 } else {
libavcodec/rv10.c+1−1
@@ -603,7 +603,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, AVFrame *pict, · 602 unmodified lines
603603 int slice_count;
604604 const uint8_t *slices_hdr = NULL;
605605
606− ff_dlog(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
606+ ff_dlog(avctx, "*****frame %"PRId64" size=%d\n", avctx->frame_num, buf_size);
607607
608608 /* no supplementary picture */
609609 if (buf_size == 0) {
libavcodec/smcenc.c+1−1
@@ -542,7 +542,7 @@ static int smc_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 541 unmodified lines
542542 return ret;
543543
544544 if (avctx->gop_size == 0 || !s->prev_frame->data[0] ||
545− (avctx->frame_number % avctx->gop_size) == 0) {
545+ (avctx->frame_num % avctx->gop_size) == 0) {
546546 s->key_frame = 1;
547547 } else {
548548 s->key_frame = 0;
libavcodec/snowenc.c+6−6
@@ -1607,9 +1607,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 1606 unmodified lines
16071607 pic->pict_type = pict->pict_type;
16081608 pic->quality = pict->quality;
16091609
1610− s->m.picture_number= avctx->frame_number;
1610+ s->m.picture_number= avctx->frame_num;
16111611 if(avctx->flags&AV_CODEC_FLAG_PASS2){
1612− s->m.pict_type = pic->pict_type = s->m.rc_context.entry[avctx->frame_number].new_pict_type;
1612+ s->m.pict_type = pic->pict_type = s->m.rc_context.entry[avctx->frame_num].new_pict_type;
16131613 s->keyframe = pic->pict_type == AV_PICTURE_TYPE_I;
16141614 if(!(avctx->flags&AV_CODEC_FLAG_QSCALE)) {
16151615 pic->quality = ff_rate_estimate_qscale(&s->m, 0);
@@ -1617,11 +1617,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 1 unmodified line
16171617 return -1;
16181618 }
16191619 }else{
1620− s->keyframe= avctx->gop_size==0 || avctx->frame_number % avctx->gop_size == 0;
1620+ s->keyframe= avctx->gop_size==0 || avctx->frame_num % avctx->gop_size == 0;
16211621 s->m.pict_type = pic->pict_type = s->keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
16221622 }
16231623
1624− if(s->pass1_rc && avctx->frame_number == 0)
1624+ if(s->pass1_rc && avctx->frame_num == 0)
16251625 pic->quality = 2*FF_QP2LAMBDA;
16261626 if (pic->quality) {
16271627 s->qlog = qscale2qlog(pic->quality);
@@ -1856,13 +1856,13 @@ redo_frame: · 228 unmodified lines
18561856
18571857 ff_snow_release_buffer(avctx);
18581858
1859− s->current_picture->coded_picture_number = avctx->frame_number;
1859+ s->current_picture->coded_picture_number = avctx->frame_num;
18601860 s->current_picture->pict_type = pic->pict_type;
18611861 s->current_picture->quality = pic->quality;
18621862 s->m.frame_bits = 8*(s->c.bytestream - s->c.bytestream_start);
18631863 s->m.p_tex_bits = s->m.frame_bits - s->m.misc_bits - s->m.mv_bits;
18641864 s->m.current_picture.f->display_picture_number =
1865− s->m.current_picture.f->coded_picture_number = avctx->frame_number;
1865+ s->m.current_picture.f->coded_picture_number = avctx->frame_num;
18661866 s->m.current_picture.f->quality = pic->quality;
18671867 s->m.total_bits += 8*(s->c.bytestream - s->c.bytestream_start);
18681868 if(s->pass1_rc)
libavcodec/svq1enc.c+3−3
@@ -548,10 +548,10 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx) · 547 unmodified lines
548548 SVQ1EncContext *const s = avctx->priv_data;
549549 int i;
550550
551− if (avctx->frame_number)
551+ if (avctx->frame_num)
552552 av_log(avctx, AV_LOG_DEBUG, "RD: %f\n",
553553 s->rd_total / (double)(avctx->width * avctx->height *
554− avctx->frame_number));
554+ avctx->frame_num));
555555
556556 s->m.mb_type = NULL;
557557 ff_mpv_common_end(&s->m);
@@ -684,7 +684,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, · 126 unmodified lines
684684
685685 FFSWAP(AVFrame*, s->current_picture, s->last_picture);
686686
687− if (avctx->gop_size && (avctx->frame_number % avctx->gop_size))
687+ if (avctx->gop_size && (avctx->frame_num % avctx->gop_size))
688688 s->pict_type = AV_PICTURE_TYPE_P;
689689 else
690690 s->pict_type = AV_PICTURE_TYPE_I;
libavcodec/svq3.c+2−2
@@ -1542,12 +1542,12 @@ static int svq3_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 1541 unmodified lines
15421542 left = buf_size*8 - get_bits_count(&s->gb_slice);
15431543
15441544 if (s->mb_y != s->mb_height || s->mb_x != s->mb_width) {
1545− av_log(avctx, AV_LOG_INFO, "frame num %d incomplete pic x %d y %d left %d\n", avctx->frame_number, s->mb_y, s->mb_x, left);
1545+ av_log(avctx, AV_LOG_INFO, "frame num %"PRId64" incomplete pic x %d y %d left %d\n", avctx->frame_num, s->mb_y, s->mb_x, left);
15461546 //av_hex_dump(stderr, buf+buf_size-8, 8);
15471547 }
15481548
15491549 if (left < 0) {
1550− av_log(avctx, AV_LOG_ERROR, "frame num %d left %d\n", avctx->frame_number, left);
1550+ av_log(avctx, AV_LOG_ERROR, "frame num %"PRId64" left %d\n", avctx->frame_num, left);
15511551 return -1;
15521552 }
15531553
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929
3030 #include "version_major.h"
3131
32−#define LIBAVCODEC_VERSION_MINOR 1
32+#define LIBAVCODEC_VERSION_MINOR 2
3333 #define LIBAVCODEC_VERSION_MICRO 100
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
libavcodec/version_major.h+1−0
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #define FF_API_VT_OUTPUT_CALLBACK (LIBAVCODEC_VERSION_MAJOR < 61)
4545 #define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 61)
4646 #define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61)
47+#define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61)
4748
4849 // reminder to remove CrystalHD decoders on next major bump
4950 #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61)
libavcodec/vp3.c+3−3
@@ -2654,8 +2654,8 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 2653 unmodified lines
26542654 s->qps[i] = -1;
26552655
26562656 if (s->avctx->debug & FF_DEBUG_PICT_INFO)
2657− av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n",
2658− s->keyframe ? "key" : "", avctx->frame_number + 1, s->qps[0]);
2657+ av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%"PRId64": Q index = %d\n",
2658+ s->keyframe ? "key" : "", avctx->frame_num + 1, s->qps[0]);
26592659
26602660 s->skip_loop_filter = !s->filter_limit_values[s->qps[0]] ||
26612661 avctx->skip_loop_filter >= (s->keyframe ? AVDISCARD_ALL
@@ -2701,7 +2701,7 @@ static int vp3_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 39 unmodified lines
27012701 }
27022702 #endif
27032703 s->version = version;
2704− if (avctx->frame_number == 0)
2704+ if (avctx->frame_num == 0)
27052705 av_log(s->avctx, AV_LOG_DEBUG,
27062706 "VP version: %d\n", s->version);
27072707 }
libavcodec/wcmv.c+1−1
@@ -156,7 +156,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, · 155 unmodified lines
156156 if (bytestream2_get_bytes_left(&gb) < 8LL * blocks)
157157 return AVERROR_INVALIDDATA;
158158
159− if (!avctx->frame_number) {
159+ if (!avctx->frame_num) {
160160 ptrdiff_t linesize[4] = { s->prev_frame->linesize[0], 0, 0, 0 };
161161 av_image_fill_black(s->prev_frame->data, linesize, avctx->pix_fmt, 0,
162162 avctx->width, avctx->height);
libavcodec/wmaprodec.c+3−3
@@ -1678,7 +1678,7 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, · 1677 unmodified lines
16781678 skip_bits(gb, 2);
16791679 } else {
16801680 int num_frames = get_bits(gb, 6);
1681− ff_dlog(avctx, "packet[%d]: number of frames %d\n", avctx->frame_number, num_frames);
1681+ ff_dlog(avctx, "packet[%"PRId64"]: number of frames %d\n", avctx->frame_num, num_frames);
16821682 packet_sequence_number = 0;
16831683 }
16841684
@@ -1687,10 +1687,10 @@ static int decode_packet(AVCodecContext *avctx, WMAProDecodeCtx *s, · 2 unmodified lines
16871687 if (avctx->codec_id != AV_CODEC_ID_WMAPRO) {
16881688 skip_bits(gb, 3);
16891689 s->skip_packets = get_bits(gb, 8);
1690− ff_dlog(avctx, "packet[%d]: skip packets %d\n", avctx->frame_number, s->skip_packets);
1690+ ff_dlog(avctx, "packet[%"PRId64"]: skip packets %d\n", avctx->frame_num, s->skip_packets);
16911691 }
16921692
1693− ff_dlog(avctx, "packet[%d]: nbpf %x\n", avctx->frame_number,
1693+ ff_dlog(avctx, "packet[%"PRId64"]: nbpf %x\n", avctx->frame_num,
16941694 num_bits_prev_frame);
16951695
16961696 /** check for packet loss */
libavcodec/yop.c+1−1
@@ -207,7 +207,7 @@ static int yop_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 206 unmodified lines
207207 if ((ret = ff_reget_buffer(avctx, frame, 0)) < 0)
208208 return ret;
209209
210− if (!avctx->frame_number)
210+ if (!avctx->frame_num)
211211 memset(frame->data[1], 0, AVPALETTE_SIZE);
212212
213213 s->dstbuf = frame->data[0];
tools/decode_simple.c+3−3
@@ -38,7 +38,7 @@ static int decode_read(DecodeContext *dc, int flush) · 37 unmodified lines
3838 int ret = 0;
3939
4040 while (ret >= 0 &&
41− (dc->max_frames == 0 || dc->decoder->frame_number < dc->max_frames)) {
41+ (dc->max_frames == 0 || dc->decoder->frame_num < dc->max_frames)) {
4242 ret = avcodec_receive_frame(dc->decoder, dc->frame);
4343 if (ret < 0) {
4444 if (ret == AVERROR_EOF) {
@@ -55,11 +55,11 @@ static int decode_read(DecodeContext *dc, int flush) · 10 unmodified lines
5555 if (ret < 0)
5656 return ret;
5757
58− if (dc->max_frames && dc->decoder->frame_number == dc->max_frames)
58+ if (dc->max_frames && dc->decoder->frame_num == dc->max_frames)
5959 return 1;
6060 }
6161
62− return (dc->max_frames == 0 || dc->decoder->frame_number < dc->max_frames) ? 0 : 1;
62+ return (dc->max_frames == 0 || dc->decoder->frame_num < dc->max_frames) ? 0 : 1;
6363 }
6464
6565 int ds_run(DecodeContext *dc)
tools/scale_slice_test.c+2−2
@@ -100,8 +100,8 @@ static int process_frame(DecodeContext *dc, AVFrame *frame) · 99 unmodified lines
100100
101101 if (memcmp(pd->frame_ref->data[i], pd->frame_dst->data[i],
102102 pd->frame_ref->linesize[i] * (pd->frame_ref->height >> shift))) {
103− fprintf(stderr, "mismatch frame %d seed %u\n",
104− dc->decoder->frame_number - 1, pd->random_seed);
103+ fprintf(stderr, "mismatch frame %"PRId64" seed %u\n",
104+ dc->decoder->frame_num - 1, pd->random_seed);
105105 return AVERROR(EINVAL);
106106 }
107107 }
tools/venc_data_dump.c+1−1
@@ -38,7 +38,7 @@ static int process_frame(DecodeContext *dc, AVFrame *frame) · 37 unmodified lines
3838 if (!frame)
3939 return 0;
4040
41− fprintf(stdout, "frame %d\n", dc->decoder->frame_number - 1);
41+ fprintf(stdout, "frame %"PRId64"\n", dc->decoder->frame_num - 1);
4242
4343 sd = av_frame_get_side_data(frame, AV_FRAME_DATA_VIDEO_ENC_PARAMS);
4444 if (sd) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t