summaryrefslogtreecommitdiff
path: root/libavcodec/videotoolboxenc.c
diff options
context:
space:
mode:
authorZhao Zhili <zhilizhao@tencent.com>2023-06-09 19:14:55 +0800
committerZhao Zhili <zhilizhao@tencent.com>2023-06-19 12:19:37 +0800
commitf66e1862e3140a6d6ba9d35243827832e26b61a1 (patch)
treecedfe9cf9e358e242cf1a6471bb5ad96a071168d /libavcodec/videotoolboxenc.c
parent3fafc842f191454313f9e0b92f62148b2e328c97 (diff)
avcodec/videotoolboxenc: inherit profile from AVCodecContext
This can happen when user set the avctx->profile field directly instead of specify profile via option. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'libavcodec/videotoolboxenc.c')
-rw-r--r--libavcodec/videotoolboxenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 9f65519700..a313087876 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -1746,6 +1746,9 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
pthread_mutex_init(&vtctx->lock, NULL);
pthread_cond_init(&vtctx->cv_sample_sent, NULL);
+ // It can happen when user set avctx->profile directly.
+ if (vtctx->profile == FF_PROFILE_UNKNOWN)
+ vtctx->profile = avctx->profile;
vtctx->session = NULL;
status = vtenc_configure_encoder(avctx);
if (status) return status;