From patchwork Fri Jun 17 05:44:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 36293 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp1320885pzb; Thu, 16 Jun 2022 22:45:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tmzlrS9lfcEWtfFlNt8BNoYDD10okl1TXZNSY7HSK7JeV0oXrgw2IQ3T8pvpLDN+3xYl2j X-Received: by 2002:a17:907:a064:b0:711:c819:3cbf with SMTP id ia4-20020a170907a06400b00711c8193cbfmr8050347ejc.460.1655444731237; Thu, 16 Jun 2022 22:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655444731; cv=none; d=google.com; s=arc-20160816; b=RV5WQLVrx3ww75z9xdzEO5T0PcL5qi3itQKp8g/UiG3T2pCO6GRR2Fb5Z6wP7Da/X7 K9ZLreawyhKvKS5+VkoDrzV1ZKXl2/XSsHQCYiJYA5lshY/gmlK3vGMlRzj547UGzLSU 33oWvzq3gWY8Gx35JtjlNQXwwubZmz+hVBgAlIBI5vMxd3a8U2q8vVODrgBtYW04rIIG Ia664F2xKfxxJp/Ow8LlIL9nm2A2d60MQnLfpi5usDlnwlaxEo+1P9/tLapPDQawLB1Z ZzVX8i9HSR17o5qANXOKKL0powYt4QoMKJskFH7QHAEGXJc7pifRTofv1Kak4w0i0CrC Mv7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=L9+dQAPm/Kh34uC5DDQZEjUZzSjRptac7RIedVte0/8=; b=DWvDEfM567bp8s2+6ujCAgt1NFV8yyQgbhb9gumrKSSQpgBoS4S0wMiCtil+IDf+WN ASTimyip8GBSI/Es7z4DUJfzOIbVdf3XcF76hcCZOP0TDKDbwvN0CUvdedxGTF+mQFC0 1Pg8NlNIoWKFck92/NUmjRtwLoPcDzOc6156cj627ye/gY9cVlrMa5eqDawclHQbBpPN OLp2n5t0McFtFxA3OmzDUedCFef5d14CPQRyUwrobeUo16YxUXoN9o7mt77yE0GfKPcS nPlFK09M7BBdlYXvuvGONaDkhPieEenDXtfvwiSbR9GagAMO3gFewDG5437sXY5hSs50 7NJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hb33-20020a170907162100b006f37ff30509si4635326ejc.508.2022.06.16.22.45.29; Thu, 16 Jun 2022 22:45:31 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5D6C268B7C5; Fri, 17 Jun 2022 08:45:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [80.241.56.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 104A168B79F for ; Fri, 17 Jun 2022 08:45:20 +0300 (EEST) Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4LPSgK5FQsz9sR4 for ; Fri, 17 Jun 2022 07:45:17 +0200 (CEST) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Fri, 17 Jun 2022 11:14:51 +0530 Message-Id: <20220617054451.6127-1-ffmpeg@gyani.pro> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4LPSgK5FQsz9sR4 Subject: [FFmpeg-devel] [PATCH] avcodec/mfenc: set frame size for audio encoders. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: LldO0aFw/XCR 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;