hevc: Add support for alternative transfer characterics SEI
[ffmpeg.git] / libavcodec / hevcdec.c
index 095564b..3b24fb9 100644 (file)
@@ -2725,6 +2725,12 @@ static int set_side_data(HEVCContext *s)
         s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
     }
 
+    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;
+    }
+
     return 0;
 }