Quoting James Almer (2024-11-27 14:31:35)
> @@ -222,10 +223,25 @@ static int dovi_rpu_init(AVBSFContext *bsf)
>  
>              s->enc.cfg = *cfg;
>          } else {
> +            AVCodecContext *avctx;
>              av_log(bsf, AV_LOG_WARNING, "No Dolby Vision configuration 
> record "
>                     "found? Generating one, but results may be invalid.\n");
> -            ret = ff_dovi_configure_ext(&s->enc, bsf->par_out, NULL, 
> s->compression,
> +            avctx = avcodec_alloc_context3(NULL);
> +            if (!avctx)
> +                return AVERROR(ENOMEM);
> +            ret = avcodec_parameters_to_context(avctx, bsf->par_in);
> +            if (ret < 0) {
> +                avcodec_free_context(&avctx);
> +                return ret;
> +            }
> +            ret = ff_dovi_configure_ext(&s->enc, avctx, NULL, s->compression,
>                                          FF_COMPLIANCE_NORMAL);
> +            if (ret < 0) {
> +                avcodec_free_context(&avctx);
> +                return ret;
> +            }
> +            ret = avcodec_parameters_from_context(bsf->par_out, avctx);

This still seems a bit too scorched-earth to me. I'd prefer to give
ff_dovi_configure_ext() a side data list as a parameter and have it
modify that.

-- 
Anton Khirnov
_______________________________________________
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".

Reply via email to