Default avctx->frame_size is 0 which leads to init failure for
audio MediaFoundation encoders.
---
 libavcodec/mfenc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
index 13ed7b3e11..ff9ffe4827 100644
--- a/libavcodec/mfenc.c
+++ b/libavcodec/mfenc.c
@@ -1066,6 +1066,9 @@ static int mf_init_encoder(AVCodecContext *avctx)
 
     c->main_subtype = *subtype;
 
+    if (c->is_audio && !avctx->frame_size)
+        avctx->frame_size = 1024;
+
     if ((ret = mf_create(avctx, &c->functions, &c->mft, avctx->codec, use_hw)) 
< 0)
         return ret;
 
-- 
2.36.1

_______________________________________________
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