examples/dmabuf-capture: fix frame_number deprecated in FFmpeg 6.0

Fixes the following error:

    ../examples/dmabuf-capture.c:524:33: error: 'frame_number' is deprecated [-Werror=deprecated-declarations]
      524 |                                 ctx->avctx->frame_number, get_fifo_size(&ctx->vid_frames));
          |                                 ^~~
Simon Ser 2 years ago
parent bec94cc040
commit 8db0d82890

@ -520,8 +520,14 @@ static void *vid_encode_thread(void *arg) {
}
};
av_log(ctx, AV_LOG_INFO, "Encoded frame %i (%i in queue)\n",
ctx->avctx->frame_number, get_fifo_size(&ctx->vid_frames));
int64_t frame_num;
#if LIBAVUTIL_VERSION_MAJOR >= 58
frame_num = ctx->avctx->frame_num;
#else
frame_num = ctx->avctx->frame_number;
#endif
av_log(ctx, AV_LOG_INFO, "Encoded frame %"PRIi64" (%i in queue)\n",
frame_num, get_fifo_size(&ctx->vid_frames));
} while (!ctx->err);

Loading…
Cancel
Save