Hiding nb_side_data depreciation warnings for now (but I added a TODO for a reminder)

This commit is contained in:
Jonathan Thomas
2025-03-11 23:12:39 -05:00
parent 4abe4cdab0
commit c608ef6918

View File

@@ -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<int32_t *>(sd->data));
if (isnan(rotation))