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 5E8F64513F for ; Wed, 12 Jul 2023 11:40:36 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 57CFA68C43F; Wed, 12 Jul 2023 14:40:34 +0300 (EEST) Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 39D6268C27D for ; Wed, 12 Jul 2023 14:40:28 +0300 (EEST) Received: by mail-oo1-f48.google.com with SMTP id 006d021491bc7-565a8d74daeso414129eaf.1 for ; Wed, 12 Jul 2023 04:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689162026; x=1691754026; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=dfFmMShd60CVPubiRiKG3YYKscqKKKpPfMPQBd3oOsU=; b=GWpZjZcT0xZMfqqYjDRc1N16XW8oodQtUAPhaTvw8cCmtsedEh0u/Js4E9O1FmLpnC Nog/ahLnpfqvxn1Mi+E/3uwgO8nc+ShEnF9A2YTQnKvQqFF9zsPE2sg5KyHboDIsd+QD DofK0dc2+JQ+9NPDaetleG9ya7oPve4ujpQz1cyY1JecKfZLt+FOjvJy+8ZCO0GjKlwQ Wto4Vw+TFFG1vAxJTxpjDMP+5x7tYQV9CGeLuUHftZz8rxasG80bYZORkuT9gGtj6hI2 5Nftg9wJmHziZdblBqK79NZdVN6JxicGQX5BqoPh3/jjwn83URa8y2YsVZVXgnOtwr7i mdyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689162026; x=1691754026; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=dfFmMShd60CVPubiRiKG3YYKscqKKKpPfMPQBd3oOsU=; b=hsop9K7+mZWYjTrfYUdPd6+9MoWcF3/XH4ynUmw2GM51wnuZ/NXY0Nlcs3BIq5t8q+ j0mwNPpnQuzh6Q7hteyZ+9fvwWE5V2QKzrWN1cPuF8Y6uGiOA9h+/YbbuzNqfcmCgz+Z 524P5T4LODHT65YjWqcrsq8aVS+6hQMTjU/BFTvZ1vPRS1CbHqrqu2RxWwPzR+XyRs7O J214mEeIUYMEPLDLuvYP7v5M7RyAW6FllsKn7Y2eribjUmVSCXKBJkb8F1c12Pspny+Y nPiQbJpk2aRNu0592Nakf6Jl06oDpuwphDkVqSN3tayIqW41v9K+uy/d5bhzkgCGzqvR tVIw== X-Gm-Message-State: ABy/qLaoHIiImzoZql54r2I3h3l+euRq1qUl8s5rs4pmTlY5+hP3DuDW Gdi2LpZr5Gd1WibGJ9LUMY6swYDdUlc= X-Google-Smtp-Source: APBJJlGLAXWho1lQnZYcYdlJ7bJ/yW/tWma6Ln3o/ZNt9CHfy2af+fiFqiU51qCgEP5nNYqxCliKDQ== X-Received: by 2002:a4a:2549:0:b0:563:4eeb:b5ea with SMTP id v9-20020a4a2549000000b005634eebb5eamr1370592ooe.4.1689162026148; Wed, 12 Jul 2023 04:40:26 -0700 (PDT) Received: from [192.168.0.16] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id e194-20020a4a55cb000000b00565fcfabab8sm1753975oob.21.2023.07.12.04.40.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Jul 2023 04:40:25 -0700 (PDT) Message-ID: <54f0bb7d-40b2-0367-e6b4-afd061943386@gmail.com> Date: Wed, 12 Jul 2023 08:40:25 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: <20230712020644.22606-1-jamrial@gmail.com> <20230712020644.22606-2-jamrial@gmail.com> <168915292003.27367.16639739053405203878@lain.khirnov.net> From: James Almer In-Reply-To: <168915292003.27367.16639739053405203878@lain.khirnov.net> Subject: Re: [FFmpeg-devel] [PATCH 2/2] avcodec/decode: don't discard the buffered packet if the underlying bsf can't take it 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/12/2023 6:08 AM, Anton Khirnov wrote: > Quoting James Almer (2023-07-12 04:06:44) >> Signed-off-by: James Almer >> --- >> libavcodec/decode.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/libavcodec/decode.c b/libavcodec/decode.c >> index 239ad70b41..cd49cca7c2 100644 >> --- a/libavcodec/decode.c >> +++ b/libavcodec/decode.c >> @@ -242,7 +242,8 @@ int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt) >> (!AVPACKET_IS_EMPTY(avci->buffer_pkt) || dc->draining_started)) { >> ret = av_bsf_send_packet(avci->bsf, avci->buffer_pkt); >> if (ret < 0) { >> - av_packet_unref(avci->buffer_pkt); >> + if (ret != AVERROR(EAGAIN)) >> + av_packet_unref(avci->buffer_pkt); > > It seems very wrong for ff_decode_get_packet() to return EAGAIN when > we have a buffered packet. The idea is preventing dropping a packet in the hypothetical case the bsf can't take it. Is this scenario possible, or is the call to av_bsf_receive_packet() within the loop ensuring it wont? _______________________________________________ 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".