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 13F28437BF for ; Tue, 28 Jun 2022 15:06:18 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AE1AD68B970; Tue, 28 Jun 2022 18:06:15 +0300 (EEST) Received: from out162-62-57-252.mail.qq.com (out162-62-57-252.mail.qq.com [162.62.57.252]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 786E468B799 for ; Tue, 28 Jun 2022 18:06:08 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1656428764; bh=CqLvMpqfPoLPpC+kGmH8DHyDtEzcupVOF5hoZGvW17Q=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=FoYlRZQd2QSWX4Ufzbw4B2dk1q2ln8p0WGTPTN6FchroGZD8hEGhe7aU3c2PQ+syJ SQ4pmP7PlSEN5X8qNtIVJ6JHF3EvyrkYmyCV+COgZmQqhrs8W//cUCIZdKuvhRSd+j 3n0HHkbw86MNAmLSnY/GRrOn3cp9U3Ju78LqXZ3I= Received: from [192.168.255.10] ([113.116.30.232]) by newxmesmtplogicsvrsza32.qq.com (NewEsmtp) with SMTP id 182B9E2A; Tue, 28 Jun 2022 23:06:02 +0800 X-QQ-mid: xmsmtpt1656428762ta6g2p6gg Message-ID: X-QQ-XMAILINFO: OZZSS56D9fAjpTM4SEa2iYcjTcfD4xXLxk2pS7WznPZ4Md3/UyDYX71ZlAmHvD 29NiD9LQ69IlqSonBAPIT+JUSsTjhMFlte2B4D/p8YuRAAYk3JhQkL7yR+lpQF8kX1ki6mfdDqGv MRpTOEhOVV6BvcZ5a/AOmH1+FPNr+zfEuQ7AfN0ytgTgSexIcUV6TQADl+LBSlf69QP/ZL9MbVCR Ds/Q/wYII0obBXi2TTXOVwpeB/et0/xtm7LLN6gJcGcimj5FfA9RtH+tY/Z/RWQGug26qdROsPuO 4XPbsrWpvvSjNMNe1uWA+mfeTQbeYOCy16yHO3GebH8QmgkBfLDD9iW/3XHWBxegfQgdKvlbQRwT ltDV+cSHwUSscuI96Sm3MDS9WmikbC25PmW9+jNNmSHDE4zSCn/DlPqu7oSlnP+yzguAD8uqyvSo MRSzoDPyHiGazUBi70y5SBbDz1S4veA4UKc9VJmq7fxbA/WNAiUGV4eB7y8VfbIkTzFluPu1TanF QM6rBB9bDEglRqPJOwZdeXr3r/acCJytbW2kofFplaKAOYcfdAwMZ0eY6rKRDsB8/noEZaiSmikI z9nKouZ/y7afFeoevsefk7I4Ow1vaXZPtET+KMfrybnyy6ZjX+Lu6XhNhA/MVXWQYUG17I7RSduw V+UNgitTyB+IXymncHh7KUxfnz3IaYRjTihcYY6PhJ01sREnJxGOqcueppi72nCUxL0LNeaLW4iu Gl2VVMEsUWaMDelZxw0cxiZhsNTytQT7UKSijJfzPthqvog5sHl/kX0xjcCcXLfRALEIIhaRKBVf EphYmQYfboKBFKn5mIWdjzY6142IzGEwKff6rISiA3nkVjQ4NrCbdeXslec+PdyUKI4nZzbUyDsl lMaWlrLMMfVADsMuqnmJp8Cezw2l61/rfF/dM062RtX1l6HBKFj2QryE1BO9xPcEzwJSrkufm2FT Xkh0HUs6bOjB50LkrpErV+0ccKu61AMAWRHLSsUCOUOnc5i3/xjg== Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.21\)) From: =?utf-8?B?InpoaWxpemhhbyjotbXlv5fnq4spIg==?= In-Reply-To: <20220628144236.2155-1-lq@chinaffmpeg.org> Date: Tue, 28 Jun 2022 23:06:02 +0800 X-OQ-MSGID: References: <20220628144236.2155-1-lq@chinaffmpeg.org> To: FFmpeg development discussions and patches X-Mailer: Apple Mail (2.3654.60.0.2.21) Subject: Re: [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: > On Jun 28, 2022, at 10:42 PM, Steven Liu wrote: > > 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); How about keep the old behavior before 7c05b7951, and return early in the error path? diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c index 00293154bf..8bbaabd960 100644 --- a/libavcodec/audiotoolboxenc.c +++ b/libavcodec/audiotoolboxenc.c @@ -554,13 +554,12 @@ static int ffat_encode(AVCodecContext *avctx, AVPacket *avpkt, avctx->frame_size, &avpkt->pts, &avpkt->duration); - ret = 0; } else if (ret && ret != 1) { av_log(avctx, AV_LOG_ERROR, "Encode error: %i\n", ret); - ret = AVERROR_EXTERNAL; + return AVERROR_EXTERNAL; } - return ret; + return 0; } static av_cold void ffat_encode_flush(AVCodecContext *avctx) > > 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". _______________________________________________ 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".