Fix video metadata rotation reading.

This commit is contained in:
John Preston
2025-12-19 16:17:23 +04:00
parent 28434f4bee
commit b04866a2fc

View File

@@ -648,7 +648,8 @@ int ReadRotationFromMetadata(not_null<AVStream*> stream) {
AV_PKT_DATA_DISPLAYMATRIX);
auto theta = 0;
if (displaymatrix) {
theta = -round(av_display_rotation_get((int32_t*)displaymatrix));
const auto matrix = (int32_t*)displaymatrix->data;
theta = -round(av_display_rotation_get(matrix));
}
theta -= 360 * floor(theta / 360 + 0.9 / 360);
const auto result = int(base::SafeRound(theta));