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 E72D745DCE for ; Wed, 12 Jul 2023 13:33:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2B45468C5F0; Wed, 12 Jul 2023 16:33:50 +0300 (EEST) Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 77D3968C50A for ; Wed, 12 Jul 2023 16:33:43 +0300 (EEST) Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-1b0719dd966so6307813fac.1 for ; Wed, 12 Jul 2023 06:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689168821; x=1691760821; 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=rGDf/HQB4GZXc55BYFUig5icl7Lxq1hchU6sWdHXEg4=; b=CII1zrrzGU88WTg56j1exUC3vSzve1q4pDvLyV41sPVD9iw2XrAjslaQMlycAdFbYl vvs3Svecd9BLYV5sdCKOoX/fkfH01s+iXOVfXdpsxsWGnMiguazrHvoQFs+TVPHwooIE aTrl90bqdyrG680R/VzuqgVJr8su7n8PiEoCBnWtoqvBx12E7VOZmg//kUWGdTeRlBBY F1wanXzLpJdLv1Lq8cm+4V5Su/mUatrg1s3lr2K3eeyb+PAZBFc/RNLcjPiazoKt7kSr bUMjDhNMtKJl1U7Qq7fxQFKeHbFmVghZMDDNOpmFhypx6DEqrpjwi6roR2nMGDUxgsDn uyTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689168821; x=1691760821; 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=rGDf/HQB4GZXc55BYFUig5icl7Lxq1hchU6sWdHXEg4=; b=HXOpuNHUVmbJvbZDA18nJY/5jVvJORS7GdN4asaZ05K3j1HYTvvZwyqijXpyTKWJrJ aMpoIkJKW7P5WWcaxKThNgeW8Fa30EPel1/TL+grpUzXXWyNRj/uriRDldr1RVUpewE+ SMfJuyEWQ4+dn5Du2eErxDINadLktYkouFamWqqUfiaBWg6JHxlvqSjdoiTP24PqQYte XZCVUX/4XbNSYjC1S/DWlHdZuKMe2MEe0Iy09VuO3/Giu+NDbVhsyN6QpgkgVigN/ZcE b3f3h4FOW+7qycIMz6uCQwglzC9WH5u5ogp6uUmW975QQK4TJSIFWGw/F0fiCFDFsTVY 7Zvw== X-Gm-Message-State: ABy/qLYbVLMznOmQmxedazSfE4VQ4MHm56v1DJmegxSlY6MZH3mt3+ud hJd2Fh0W3ms/I7QYzXWJOFu3Lcigq08= X-Google-Smtp-Source: APBJJlGLw3v3cCqmG4JpIT/0LhExWXVJE/N5Xr/MHnaooqMIMWGSFpVpnejH9ND7qkz0uWro14Wlwg== X-Received: by 2002:a05:6870:1718:b0:1b7:72bb:c67b with SMTP id h24-20020a056870171800b001b772bbc67bmr1937863oae.29.1689168821444; Wed, 12 Jul 2023 06:33:41 -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 j4-20020a056830014400b006b9734b9fafsm1900666otp.13.2023.07.12.06.33.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Jul 2023 06:33:41 -0700 (PDT) Message-ID: Date: Wed, 12 Jul 2023 10:33:40 -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> <54f0bb7d-40b2-0367-e6b4-afd061943386@gmail.com> <168916872158.27367.6160923801928996925@lain.khirnov.net> From: James Almer In-Reply-To: <168916872158.27367.6160923801928996925@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 10:32 AM, Anton Khirnov wrote: > Quoting James Almer (2023-07-12 13:40:25) >> 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? > > This block can only be entered if decode_get_packet() returned EAGAIN, > which should always mean that the bsf is empty. Right, patch dropped then. _______________________________________________ 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".