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 6691746D2F for ; Sun, 9 Jul 2023 19:37:46 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BC81468C6B1; Sun, 9 Jul 2023 22:37:43 +0300 (EEST) Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 19CF768C2A3 for ; Sun, 9 Jul 2023 22:37:37 +0300 (EEST) Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-6b71eef1bc0so3123497a34.2 for ; Sun, 09 Jul 2023 12:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688931455; x=1691523455; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=hyjNsOhi7trsvTGq32Zn3ys7P7svMgeCJ28ULkV7D7s=; b=dEJia9kSn6kklAPsrBrES06RQZEDlZl/2TpGtuOFNVV27+XhepITLoqm7z4fLQpH6A DM4s6ES3G0vpL7sqQbVkCIczNlJ0380yX+usar6B6pASzvZtsapigHqdVVe4h1cokyRb ojKd5D6y+9PXETnbcgLREOOch+7tSBqC7t3GSp+3HuO3bmEu2NPjtlTC63GQwlD16sqe OwDkVHAD2HQYQmhKMl1NOicBUwb7eOVU2iyp71dHHwj6wKX7PSqASyG2+2xRMWFhdGE1 OopoBYOk+ZsNOnqEmB0lNFQtsIQ0pPxiDbiuGEIEbhRTb3sQtqjmEpz38VVQhKFm59uq QjIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688931455; x=1691523455; h=content-transfer-encoding:in-reply-to:references:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hyjNsOhi7trsvTGq32Zn3ys7P7svMgeCJ28ULkV7D7s=; b=VGXlyeZGX0uyIiB2yvPFnUzAz1RNpndhenhee9LWihkGcUck0Kc7CejO0sAAHN7RQF FbBKQ5/e+HPnb4ohHSzOM5XSLAlkUSkgZeF8AP2FV5ZNCMfjR272Kb2R20Wj8/tGpfgC 2z/QCgL0kSCGuJzQG+ZMAqiP0hAa6shTx/f+2zrk6KHFdqHYBFikE73pKct2pcYrBppf +jHh4kEskAsgSHj5lTmgyPn+DYhJdUcnt8OdMGfsPu2wfMKOYytrnimo/teI4x35+Kpg 7AQXw8RulPLNn2Dy1QwzP6+dKILFtyOqRgKAS/FAvfdp0LMPnyI4rUibwv3paFKdLlYQ azYQ== X-Gm-Message-State: ABy/qLa3DfxQ+ZanLxZ7PKN9TYoRqHrrobwZ3s0jwf7jFGm43uY8YkgR boH3CtAwUDeW3JusDEfsVPsU2Vybe7Y= X-Google-Smtp-Source: APBJJlEbXnm0kce+PbxbmBrphrHMO2oHx2U1VWLsWjwGVkzLDhUJmUwb1LjzVJfubEQpv1l4i0mZWg== X-Received: by 2002:a05:6870:4205:b0:1b0:49a7:c285 with SMTP id u5-20020a056870420500b001b049a7c285mr10256582oac.24.1688931455147; Sun, 09 Jul 2023 12:37:35 -0700 (PDT) Received: from [192.168.0.12] (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id v20-20020a9d7d14000000b006b90b5626desm2795001otn.62.2023.07.09.12.37.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Jul 2023 12:37:34 -0700 (PDT) Message-ID: <453707c4-3bf0-b882-5593-db8de829e87e@gmail.com> Date: Sun, 9 Jul 2023 16:37:36 -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 From: James Almer To: ffmpeg-devel@ffmpeg.org References: <20230709133917.5403-1-jamrial@gmail.com> <20230709133917.5403-2-jamrial@gmail.com> In-Reply-To: <20230709133917.5403-2-jamrial@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH v2 2/3] avcodec/decode: check the output frame for discard samples with all decoders 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/9/2023 10:39 AM, James Almer wrote: > And not just those with the old decode() API. > > Signed-off-by: James Almer > --- > libavcodec/decode.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/libavcodec/decode.c b/libavcodec/decode.c > index a39af2d014..b3e4b066e5 100644 > --- a/libavcodec/decode.c > +++ b/libavcodec/decode.c > @@ -597,6 +597,14 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) > if (codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME) { > ret = codec->cb.receive_frame(avctx, frame); > emms_c(); > + if (!ret) { > + if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) > + ret = (frame->flags & AV_FRAME_FLAG_DISCARD) ? AVERROR(EAGAIN) : 0; > + else if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) { > + int64_t discarded_samples = 0; > + ret = discard_samples(avctx, frame, &discarded_samples); > + } > + } > } else > ret = decode_simple_receive_frame(avctx, frame); I'm withdrawing this patch for now. discard_samples() uses avci->last_pkt_props to fetch SKIP_SAMPLES packet side data which is not necessarily correct on receive_frame() decoders (like those setting FF_CODEC_CAP_SETS_FRAME_PROPS). _______________________________________________ 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".