avcodec/librav1e: support setting sample aspect ratio

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2022-10-09 20:35:43 -03:00
parent 30e1f5ec77
commit d569958d29
1 changed files with 6 additions and 0 deletions

View File

@ -298,6 +298,12 @@ static av_cold int librav1e_encode_init(AVCodecContext *avctx)
goto end;
}
if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0)
rav1e_config_set_sample_aspect_ratio(cfg, (RaRational) {
avctx->sample_aspect_ratio.num,
avctx->sample_aspect_ratio.den
});
rret = rav1e_config_parse_int(cfg, "threads", avctx->thread_count);
if (rret < 0)
av_log(avctx, AV_LOG_WARNING, "Invalid number of threads, defaulting to auto.\n");