summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2017-03-12 13:21:01 +0100
committerClément Bœsch <u@pkh.me>2017-03-12 13:21:01 +0100
commit5e193daaa28d2fca34ad21d11d58f0b135388246 (patch)
tree7ed9b84ef7aba38431256d8f8bd934755e478da4 /libavcodec
parent8d2d81709882a72ba5fbeccd3ce3da48ff258e96 (diff)
parentf65285aba0df7d46298abe0c945dfee05cbc6028 (diff)
Merge commit 'f65285aba0df7d46298abe0c945dfee05cbc6028'
* commit 'f65285aba0df7d46298abe0c945dfee05cbc6028': lavc: set sw_pix_fmt for hwaccel encoding Merged-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 3c8a9cc13e..4d1b63222f 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1593,6 +1593,17 @@ FF_ENABLE_DEPRECATION_WARNINGS
ret = AVERROR(EINVAL);
goto free_and_end;
}
+ if (avctx->sw_pix_fmt != AV_PIX_FMT_NONE &&
+ avctx->sw_pix_fmt != frames_ctx->sw_format) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Mismatching AVCodecContext.sw_pix_fmt (%s) "
+ "and AVHWFramesContext.sw_format (%s)\n",
+ av_get_pix_fmt_name(avctx->sw_pix_fmt),
+ av_get_pix_fmt_name(frames_ctx->sw_format));
+ ret = AVERROR(EINVAL);
+ goto free_and_end;
+ }
+ avctx->sw_pix_fmt = frames_ctx->sw_format;
}
}