From c608ef69187cb00a48354f8d01cd2f00eee250d3 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Tue, 11 Mar 2025 23:12:39 -0500 Subject: [PATCH] Hiding nb_side_data depreciation warnings for now (but I added a TODO for a reminder) --- src/FFmpegReader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index 6d8f9ccd..c23680ed 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -555,12 +555,16 @@ void FFmpegReader::Open() { } // If "rotate" isn't already set, extract it from the video stream's side data. + // TODO: nb_side_data is depreciated, and I'm not sure the preferred way to do this if (info.metadata.find("rotate") == info.metadata.end()) { for (unsigned int i = 0; i < pFormatCtx->nb_streams; i++) { if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" for (int j = 0; j < pFormatCtx->streams[i]->nb_side_data; j++) { - // Use the address-of operator to get a pointer to the j-th element. + // Get the j-th side data element. AVPacketSideData *sd = &pFormatCtx->streams[i]->side_data[j]; +#pragma GCC diagnostic pop if (sd->type == AV_PKT_DATA_DISPLAYMATRIX && sd->size >= 9 * sizeof(int32_t)) { double rotation = -av_display_rotation_get(reinterpret_cast(sd->data)); if (isnan(rotation))