Commit d4b1b3b0 authored by Clément Bœsch's avatar Clément Bœsch

Merge commit 'e62ff72f'

* commit 'e62ff72f':
  lavc: make avcodec_open2() fail when the timebase is not set for encoding
Merged-by: 's avatarClément Bœsch <u@pkh.me>
parents 70d48acc e62ff72f
...@@ -1412,6 +1412,13 @@ FF_DISABLE_DEPRECATION_WARNINGS ...@@ -1412,6 +1412,13 @@ FF_DISABLE_DEPRECATION_WARNINGS
} }
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif
if (avctx->time_base.num <= 0 || avctx->time_base.den <= 0) {
av_log(avctx, AV_LOG_ERROR, "The encoder timebase is not set.\n");
ret = AVERROR(EINVAL);
goto free_and_end;
}
if (avctx->codec->sample_fmts) { if (avctx->codec->sample_fmts) {
for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) { for (i = 0; avctx->codec->sample_fmts[i] != AV_SAMPLE_FMT_NONE; i++) {
if (avctx->sample_fmt == avctx->codec->sample_fmts[i]) if (avctx->sample_fmt == avctx->codec->sample_fmts[i])
......
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