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));
          |                                 ^~~
This commit is contained in:
Simon Ser 2023-02-28 11:57:07 +01:00
parent bec94cc040
commit 8db0d82890
1 changed files with 8 additions and 2 deletions

View File

@ -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);