This commit changes vp9_metadata to update the AVCodecParameters to reflect the output bitstream. This brings vp9_metadata in line with what is expected of a bitstream filter.
Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com> --- libavcodec/vp9_metadata_bsf.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libavcodec/vp9_metadata_bsf.c b/libavcodec/vp9_metadata_bsf.c index 52e962b1c0..0ce017ffea 100644 --- a/libavcodec/vp9_metadata_bsf.c +++ b/libavcodec/vp9_metadata_bsf.c @@ -107,7 +107,23 @@ fail: static int vp9_metadata_init(AVBSFContext *bsf) { + static const uint8_t conversion_table[8] = { + AVCOL_SPC_UNSPECIFIED, AVCOL_SPC_BT470BG, + AVCOL_SPC_BT709, AVCOL_SPC_SMPTE170M, + AVCOL_SPC_SMPTE240M, AVCOL_SPC_BT2020_NCL, + AVCOL_SPC_RESERVED, AVCOL_SPC_RGB + }; VP9MetadataContext *ctx = bsf->priv_data; + AVCodecParameters *par = bsf->par_out; + + if (ctx->color_space >= 0 && (par->profile & 1 || + ctx->color_space != VP9_CS_RGB)) + par->color_space = conversion_table[ctx->color_space]; + + if (par->color_space == AVCOL_SPC_RGB) + par->color_range = AVCOL_RANGE_JPEG; + else if (ctx->color_range >= 0) + par->color_range = ctx->color_range + 1; return ff_cbs_init(&ctx->cbc, AV_CODEC_ID_VP9, bsf); } -- 2.21.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".