Ticket #6370: 0001-Fix-rotation-metadata-override-when-transcoding.patch

File 0001-Fix-rotation-metadata-override-when-transcoding.patch, 1.2 KB (added by TheTroll, 8 years ago)

Fix rotation override when transcoding

  • fftools/ffmpeg.c

    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)  
    35913591            ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base);
    35923592
    35933593        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       }
    35943603    } else if (ost->stream_copy) {
    35953604        ret = init_output_stream_streamcopy(ost);
    35963605        if (ret < 0)