Commit 8788dd67 authored by Steve Lhomme's avatar Steve Lhomme Committed by James Almer

avcodec/h264_slice: set the SEI parameters early on the AVCodecContext

It's better to do it before the buffers are actually created. At least in VLC
we currently don't support changing some parameters dynamically easily so we
don't use the information if it comes after the buffer are created.
Co-authored-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent f2ad6238
......@@ -1092,6 +1092,12 @@ static int h264_init_ps(H264Context *h, const H264SliceContext *sl, int first_sl
h->avctx->colorspace = sps->colorspace;
}
}
if (h->sei.alternative_transfer.present &&
av_color_transfer_name(h->sei.alternative_transfer.preferred_transfer_characteristics) &&
h->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) {
h->avctx->color_trc = h->sei.alternative_transfer.preferred_transfer_characteristics;
}
}
if (!h->context_initialized || must_reinit || needs_reinit) {
......@@ -1332,12 +1338,6 @@ static int h264_export_frame_props(H264Context *h)
h->sei.picture_timing.timecode_cnt = 0;
}
if (h->sei.alternative_transfer.present &&
av_color_transfer_name(h->sei.alternative_transfer.preferred_transfer_characteristics) &&
h->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) {
h->avctx->color_trc = cur->f->color_trc = h->sei.alternative_transfer.preferred_transfer_characteristics;
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment