From e4fe535d12f4f30df2dd672e30304af112a5a827 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Tue, 17 Mar 2015 17:38:48 +0000 Subject: mov: Write the display matrix in order This will allow to copy the matrix as is and it is just cleaner to keep the matrix in the same order specified by the mov standard (which is also explicitly described in the documentation). In order to preserve compatibility, flip the angle sign in the display API av_display_rotation_set() and av_display_rotation_get(), and improve the documentation mentioning the rotation direction. --- libavutil/display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavutil/display.c') diff --git a/libavutil/display.c b/libavutil/display.c index 74aceb2847..f7500948ff 100644 --- a/libavutil/display.c +++ b/libavutil/display.c @@ -46,12 +46,12 @@ double av_display_rotation_get(const int32_t matrix[9]) rotation = atan2(CONV_FP(matrix[1]) / scale[1], CONV_FP(matrix[0]) / scale[0]) * 180 / M_PI; - return rotation; + return -rotation; } void av_display_rotation_set(int32_t matrix[9], double angle) { - double radians = angle * M_PI / 180.0f; + double radians = -angle * M_PI / 180.0f; double c = cos(radians); double s = sin(radians); -- cgit v1.2.3