hevc: Make sure to update the current frame transfer characteristic
authorVittorio Giovara <vittorio.giovara@gmail.com>
Thu, 20 Jul 2017 12:39:22 +0000 (14:39 +0200)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Fri, 21 Jul 2017 18:07:40 +0000 (20:07 +0200)
Otherwise the first decoded frame will still be tagged with the
original transfer instead of the alternative one.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
libavcodec/hevcdec.c

index e084d75..2306c51 100644 (file)
@@ -2729,7 +2729,7 @@ static int set_side_data(HEVCContext *s)
     if (s->sei.alternative_transfer.present &&
         av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) &&
         s->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) {
     if (s->sei.alternative_transfer.present &&
         av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) &&
         s->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) {
-        s->avctx->color_trc = s->sei.alternative_transfer.preferred_transfer_characteristics;
+        s->avctx->color_trc = out->color_trc = s->sei.alternative_transfer.preferred_transfer_characteristics;
     }
 
     return 0;
     }
 
     return 0;