From 3f2e2fa9b9d509e3443c1b9604430259aa29f6ab Mon Sep 17 00:00:00 2001
From: Gilles Vieira <gilles.vieira@dailymotion.com>
Date: Sat, 13 Oct 2018 08:15:56 +0200
Subject: [PATCH] Fix rotation metadata override when transcoding
Fixes: Ticket4560
---
fftools/ffmpeg.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index aa495b5d9e..d69c1d1652 100644
|
a
|
b
|
static int init_output_stream(OutputStream *ost, char *error, int error_len)
|
| 3591 | 3591 | ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base); |
| 3592 | 3592 | |
| 3593 | 3593 | ost->st->codec->codec= ost->enc_ctx->codec; |
| | 3594 | |
| | 3595 | // Also set the rotation override when transcoding |
| | 3596 | if (ost->rotate_overridden) { |
| | 3597 | uint8_t *sd = av_stream_new_side_data(ost->st, AV_PKT_DATA_DISPLAYMATRIX, |
| | 3598 | sizeof(int32_t) * 9); |
| | 3599 | |
| | 3600 | if (sd) |
| | 3601 | av_display_rotation_set((int32_t *)sd, -ost->rotate_override_value); |
| | 3602 | } |
| 3594 | 3603 | } else if (ost->stream_copy) { |
| 3595 | 3604 | ret = init_output_stream_streamcopy(ost); |
| 3596 | 3605 | if (ret < 0) |