[FFmpeg-devel] [PATCH 1/4] avcodec/mjpegdec: Fix exif rotation->displaymatrix conversion

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Dec 19 01:07:42 EET 2021


The cases in which there was flipping together with a rotation
that is not a multiple of the identity were wrong.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
This whole patchset relies on the mismatch in av_display_rotation_set()
being solved by keeping the current behaviour and updating the
documentation.

 libavcodec/mjpegdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 8b154ce0ab..0dbbc14bae 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2896,14 +2896,14 @@ the_end:
                     break;
                 case 5:
                     av_display_rotation_set(matrix, 90.0);
-                    av_display_matrix_flip(matrix, 0, 1);
+                    av_display_matrix_flip(matrix, 1, 0);
                     break;
                 case 6:
                     av_display_rotation_set(matrix, 90.0);
                     break;
                 case 7:
                     av_display_rotation_set(matrix, -90.0);
-                    av_display_matrix_flip(matrix, 0, 1);
+                    av_display_matrix_flip(matrix, 1, 0);
                     break;
                 case 8:
                     av_display_rotation_set(matrix, -90.0);
-- 
2.32.0



More information about the ffmpeg-devel mailing list