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 D8F6342EDA for ; Sat, 8 Jul 2023 19:01:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2C60168C529; Sat, 8 Jul 2023 22:01:03 +0300 (EEST) Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 75CCF68C3CC for ; Sat, 8 Jul 2023 22:00:56 +0300 (EEST) Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6b73a2d622dso1942735a34.0 for ; Sat, 08 Jul 2023 12:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688842854; x=1691434854; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=bS0Fhku+hmYtHQGdEzodYLvh8fuWMHk2/lXODvMebcA=; b=oB761spzaEcU6lD6QN+qhHBXKYMIa8U3+1vOgPSNQmKljI4pLtGxz7+4p8itbl2WhJ MACZHKKu81GOimYuK9gJehJNsBsjkrRAfalKYc03am2u3bWnna5YoN18hQ2bEIK7/0er UExG6Z3uY+SbezyRwgV4YlogcjhknF6omIJ0PKb/SaCAZM5/IxkT1FD72wb/aotin7VW PVvHQuJPGyLde2aqtudF/dj9iUB0g2rzl4dUh9oA/ERAT05mWU20yDD2o3jEQ/IXeviD EVun1v5ZHGzXd4D78BfLMaeCH8a2iRTSLGrjspdnMxoZK7LpzCv1mAvYzAv6d+yrDCVK CnJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688842854; x=1691434854; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bS0Fhku+hmYtHQGdEzodYLvh8fuWMHk2/lXODvMebcA=; b=jEB94s4+w1Bzry924FBpSyhnG9jzKngq68SaDsyJHkYdPhD54N9+jEgonGG8r15rsM VVzvLYuEH1NXEoq1V6NmlI+KNXscz6jtc8OmvskpzbtOHIBvtcrK6CCOA0AnllZ8+f7v ai+suowZo/YFHEkK1zCM3CYN7U5S85mZ/WsIvpiKwcpzuCJwATxw8sfCETpFuYeZqc/C MSLyL0OAW96g82c5Yv8n4ujCYxlg4Np82f4KJFTdR8HTOHMBTYACRraoog0eYEka4R3F 9znX2z3vyAYkU4oa0+qhVGDtnc+S0SB2lXD33JEKtXJxGVDuWryWkNFR1wAJ5T+Xyu6a dceA== X-Gm-Message-State: ABy/qLa391gZNwkM3LLD6eaqMANisfL4869NwfomHlMM1cfkyF6fZFrN YzFVtuLXiEiGN4/ZmetmnBZn4EKbm0w= X-Google-Smtp-Source: APBJJlEeuY3PP7/klT06nRDSXGo4lIaiIsa/Xg6alsLxEsNDH3MzBKP7Kf5nLVJsij5T7RQ8bnNwEQ== X-Received: by 2002:a05:6830:1d4b:b0:6b9:27bb:d050 with SMTP id p11-20020a0568301d4b00b006b927bbd050mr1738651oth.2.1688842854284; Sat, 08 Jul 2023 12:00:54 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id p23-20020a0568301d5700b006b92c078d05sm988738oth.31.2023.07.08.12.00.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jul 2023 12:00:53 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sat, 8 Jul 2023 16:00:37 -0300 Message-ID: <20230708190038.24324-2-jamrial@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230708190038.24324-1-jamrial@gmail.com> References: <20230708190038.24324-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 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-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: And not just those with the old decode() API. Signed-off-by: James Almer --- libavcodec/decode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 793ab975f6..49c8b7e0f4 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -594,8 +594,11 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) av_assert0(!frame->buf[0]); if (codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME) { + int64_t discarded_samples = 0; ret = codec->cb.receive_frame(avctx, frame); emms_c(); + if (!ret) + ret = discard_samples(avctx, frame, &discarded_samples); } else ret = decode_simple_receive_frame(avctx, frame); -- 2.41.0 _______________________________________________ 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".