}
}
- if (displaymatrix && !_rotation) {
- _rotation = - av_display_rotation_get ((int32_t*) displaymatrix);
+ auto side_data = av_packet_side_data_get(stream->codecpar->coded_side_data, stream->codecpar->nb_coded_side_data, AV_PKT_DATA_DISPLAYMATRIX);
+ if (side_data && !_rotation) {
+ _rotation = - av_display_rotation_get(reinterpret_cast<int32_t*>(side_data->data));
}
- _rotation = *_rotation - 360 * floor (*_rotation / 360 + 0.9 / 360);
+ if (_rotation) {
+ _rotation = *_rotation - 360 * floor (*_rotation / 360 + 0.9 / 360);
+ }
}
LOG_GENERAL("Temporal reference was %1", temporal_reference);