From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 40DFD437BB for ; Tue, 28 Jun 2022 14:43:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6184668B954; Tue, 28 Jun 2022 17:43:36 +0300 (EEST) Received: from smtpbg.qq.com (smtpbg136.qq.com [106.55.201.188]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 794B268B86A for ; Tue, 28 Jun 2022 17:43:27 +0300 (EEST) X-QQ-mid: bizesmtp65t1656427401tv73nmeu Received: from localhost ( [114.245.19.167]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 28 Jun 2022 22:43:20 +0800 (CST) X-QQ-SSF: 01100000002000Z0Z000000A0000000 X-QQ-FEAT: AYaL7CbwjQ3LTWsLxdVY5L6PG+W7Y97gXkHnw713Pmos+m0QjdalEl3l8D7xX k2zBVdktEPclDCEJ5tt9tBz0waOclzRQGuTfNprKEJnCUbsNrX8Id87Q4rcUCrCAHt/u4DP La4hSsLuxp6bDp2TCJ1r8Z7ophFWkObFGzsNP27B+JZo1txiM1Jkili6iiwWNkL/bhj9RTB n60aUq8gAOD+avkkzgkFNU3FABP1n8OI9EwP31lO6WEZnRf6L6BzCIZHNOw3IP2sm0ys3is stKfggSotFh7zuI0eV/WajEJit4u0mO7dIOl7W2fOYfIONE49OjbfELCW2i40O4x/PfTHFd M3EzZpT/N9W/gyKLOU= X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Tue, 28 Jun 2022 22:42:36 +0800 Message-Id: <20220628144236.2155-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgspam:qybgspam7 Subject: [FFmpeg-devel] [PATCH] avcodec/audiotoolboxenc: return EAGAIN if frame_queue.available is 0 and not at->eof 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 Cc: Steven Liu Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: There will return success and failure after commit 7c05b7951cb47716230c95744240bc60ec5f9433. But the AudioConverterFillComplexBuffer will return 1 and *got_packet_ptr is 0 when frame_queue.available == 0 and at->eof == 0. So should return EAGAIN here, this because the encode function should return either 0 or negative error code. Signed-off-by: Steven Liu --- libavcodec/audiotoolboxenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c index 00293154bf..c23deb06a9 100644 --- a/libavcodec/audiotoolboxenc.c +++ b/libavcodec/audiotoolboxenc.c @@ -558,7 +558,8 @@ static int ffat_encode(AVCodecContext *avctx, AVPacket *avpkt, } else if (ret && ret != 1) { av_log(avctx, AV_LOG_ERROR, "Encode error: %i\n", ret); ret = AVERROR_EXTERNAL; - } + } else if (ret == 1) + ret = AVERROR(EAGAIN); return ret; } -- 2.34.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-request@ffmpeg.org with subject "unsubscribe".