[FFmpeg-devel] PATCH: Rotation override for encoding case in metadata

Submitted by Илья Щербак on Sept. 6, 2018, 4:33 p.m.

Details

Message ID 08030B8E-756C-4865-BD1A-38ED8049EB96@gmail.com
State New
Headers show

Commit Message

Илья Щербак Sept. 6, 2018, 4:33 p.m.
From 193d415c5b6f29be8f75839d5be4a5ca03bbac10 Mon Sep 17 00:00:00 2001
From: Ilya Shcherbak <i.shcherbak@corp.vk.com>
Date: Thu, 6 Sep 2018 18:30:20 +0300
Subject: [PATCH] Added rotation override for encoding case

---
 fftools/ffmpeg.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 934dc71a74..ac1972eb94 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3573,6 +3573,11 @@  static int init_output_stream(OutputStream *ost, char *error, int error_len)
                 memcpy(dst, sd->data, sd->size);
                 if (ist->autorotate && sd->type == AV_PKT_DATA_DISPLAYMATRIX)
                     av_display_rotation_set((uint32_t *)dst, 0);
+
+                if (ost->rotate_overridden) {
+                    if (sd->type == AV_PKT_DATA_DISPLAYMATRIX)
+                        av_display_rotation_set((uint32_t *)dst, -ost->rotate_override_value);
+                }
             }
         }