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 697B9437C6 for ; Tue, 28 Jun 2022 15:22:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3982468B97B; Tue, 28 Jun 2022 18:22:25 +0300 (EEST) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B885368B934 for ; Tue, 28 Jun 2022 18:22:17 +0300 (EEST) Received: by mail-wr1-f51.google.com with SMTP id o4so14260921wrh.3 for ; Tue, 28 Jun 2022 08:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=JcHh/4LQvzQ1gBc2wl5Sc69nik2xsu+jOH0zifPNQIA=; b=PJhBec5k7+rheD0CHCO9zRl6wLYhuM8CVqryopaXS2uxloQo5lOUWrfbHxue1de5/R 8XYieAHG8Q3J1pqWTYjMRAMdeZdeSjCO3lGh1W3AHBeHOk5M12FE7402j3odtn6jczbP 1oL5MXG0vzZM0JzTu7VPzKMy24xy0Kc9Jlu2clxgoABCLL4kamYE5741iLBBycWbVa9R 2K/hmSGoU4JiUrc3xy5ueCB6+xZnpB131nf5Xjb1e1cDufvcQStG18JyxShke8aa3StR y93pEYZC7yen2qfLt8JzlPm0NvNd7maKGkB5dclHGElctm/gBbCip+nk/YMQsoX4rL78 lF0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=JcHh/4LQvzQ1gBc2wl5Sc69nik2xsu+jOH0zifPNQIA=; b=mW1L8yBUhRhxW2yGDosQVxIvfEUswxr1WR5iwSIJSDnPpaNcloFu4Y/6LioERRSb48 kqSuCpzFBZ2992Twn1RvxIvAY9eKhNwgM5Pc94Asie54xUaoLrPvTTTJozL+VsGn3JMT SHUAc5nlA9FG+l1tNTmhe65w4V9T8Bx7ctaf8phPlZYRdrU2fb1AuBa9C3N8LfpZZPoM 4A1y0YX96CZyGf/DMubFVCABcbnp/FAJpMY70b0UZ9nZlGWmSjfxzdzHf67qLHcn0Oup Wt+IEHZTqWytqYBKl+x2F8iyR1KtrsUunejhw2i84H8ruAowvfolAT9hFin+wfNq6DID 61Vw== X-Gm-Message-State: AJIora8AgqGAydGmwJOYDdUblyR/tdvCwHAx/zBUCw3bm+ahu4E9uAxK /3FJ1qj2hfFaypoV3fM/6q2EW0xnbRWNfzidS4BWZOyzghc= X-Google-Smtp-Source: AGRyM1tK9VK/GoSg1AtKxICokxHhc6lShKjqI0jvSuuQNE5HLvYYxjBJqLs6DaYyWyCVKgLLbUb7dDOAlfe0wuQ8J38= X-Received: by 2002:a05:6000:184c:b0:21b:b6ac:8cb6 with SMTP id c12-20020a056000184c00b0021bb6ac8cb6mr18094259wri.154.1656429737070; Tue, 28 Jun 2022 08:22:17 -0700 (PDT) MIME-Version: 1.0 References: <20220628144236.2155-1-lq@chinaffmpeg.org> In-Reply-To: <20220628144236.2155-1-lq@chinaffmpeg.org> From: =?UTF-8?B?SmFuIEVrc3Ryw7Zt?= Date: Tue, 28 Jun 2022 18:22:05 +0300 Message-ID: To: FFmpeg development discussions and patches 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 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 Tue, Jun 28, 2022 at 5:43 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. > This mirrors what I noted to you on IRC. Can you document what ret == 1 actually is? AudioConverterFillComplexBuffer documentation says it returns OSStatus, but with a quick look I can't see any AudioToolbox related errors in f.ex. https://www.osstatus.com/search/results?platform=all&framework=all&search=1 . If it is just equivalent of EAGAIN, then since there is no need to check for got_packet_ptr ? In any case, with errors or special cases early exit should always be preferred. See an example @ https://github.com/jeeb/ffmpeg/commits/audiotoolboxenc_return_codes . (this was originally quickly whipped up before I saw your patch, and thus does not take care of the EAGAIN case). Jan _______________________________________________ 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".