From patchwork Mon Feb 14 22:41:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 34291 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:14aa:0:0:0:0 with SMTP id bz10csp5923880nkb; Mon, 14 Feb 2022 14:42:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxkqjhbAmugQ9Q3wbElUyHXVdRhwfvKSxiHbsO1vD7mYzP2QuJUj7DrB4ygTpSkhv1fk4Bq X-Received: by 2002:a17:906:7387:: with SMTP id f7mr773372ejl.139.1644878573548; Mon, 14 Feb 2022 14:42:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644878573; cv=none; d=google.com; s=arc-20160816; b=jlnNIlmWkXqd0aPA2huREQPb19nE1nu997K+1uxxib1f8ttpfckEQl7IZje4r1f0Jy oKE9XoKk+LjoUqoJjdMcOZXfYuljBRRkIwxwTnG50hXX9/AM8PNQoa4dFVGant7cD7Bb leT9esI9hjwZgfeQrbE1z4v/68HOCSbtPYdmxN3F7z9VICfTL8VTb8G7d89qKdaswm1G uLe1RTMV2ueIwARNpZtagwsnfDzb0lCyKzWm2zCeYLNuSGvjiLZQPuMcFI2h6AZgS76o 9g1WQk1cgATeOqywycRnI9cKb1LoSDIut9TdDC2WhoHelkxMFrg0BoOv8Wa4LzX8Kiyq EsCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=72FHtbETITi9D0dY1fcAUCys3vTdla+v6f84896j9dQ=; b=ZFvxt4xrZ5VB8FCuZlHN9ow3ciX1KPq0eZBNqhJ8JHdNna8vEbVXM86s9O9YxYHWvP 2W8FAiFu6B9qbF7JU9vz+PU1APHA20bu3x0Ugwze1cpzQdKSBEXoRP77T+TFiOtr6ppY UrMLUlSHSv8Ht/VvoyDDE/mkHRSiNm64O1KPpAjCTsyD7gVi9nG/xcKyJ9O11VwyuMr3 959D5bLlc/Ilcw75ZUbS8bTHxpim0s3VQHKFBrCxulrRsAAq1HolLuzJu+O5r8DJ0cv1 bGhPHtyt5ULTjqef0npqwYxaHLw3vMFhYxAh5ze1f5pRidhcnRn43uGVHxWy7+SpPugC /lPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Ehu5InV3; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l16si9114433edw.590.2022.02.14.14.42.53; Mon, 14 Feb 2022 14:42:53 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=Ehu5InV3; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 23BA668B1C0; Tue, 15 Feb 2022 00:42:23 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 00E8768B15A for ; Tue, 15 Feb 2022 00:42:19 +0200 (EET) Received: by mail-oi1-f170.google.com with SMTP id q8so19019286oiw.7 for ; Mon, 14 Feb 2022 14:42:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KtBySlUweaMgDI0UKXWp1sHu+k9KOIE8XF2icKtaRlM=; b=Ehu5InV3rN/j3hAJEIQ1mC6XZCCjZnLJ74WOGMW00EvhczFPl1drAPxNGq8JOs2XTW e5aaxKZ4H66lABH6wsGEQMzdksxRltfW7JRiC68rAiujqpdkv5AYGiy2jcYYA74T7XLd +rJa2lTcEqkArwYgjarI5chJJL+gLrVdwQL/l2I2Zmqn9zTWEmmHn3f7W2ctk/Uo85RR zwU8Pms9HdF3BphO4tagSH1Bp32rIE61Y1zHNylEItp6gRz+mrGzVL68AE9eUY2JXrcm /cTGdhdpziQvkjXn/4bXa4THuFngqQ8H2RMt/ZM8vWnES7x30tN7sq8dGpz4jV2VeI3d u1rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KtBySlUweaMgDI0UKXWp1sHu+k9KOIE8XF2icKtaRlM=; b=Xmif6uDQLN5itx3HV3DhRHQUwuntpOT8EEsPlAOwcxg6Hu7sqMFUCf5Fk87zaO6XSS pND1PoT93WvM+B/ZxdAIr7Tk9v/SzISuv5w8jb6Yh4VSCioQsQYDofAMLSP6DfXs2vM7 WlHKw1t76BSwY9kkZ2bzYVpv9RLU6nP1ws4//XQt17Z6/NQina1hZmA87To0nUir5BXI zXroaZfUS2VwuTDbCLgLLaqDh6kMhQ3vVpZ6iwXPtAx5tAqupdxKl1fvsXTZ15RZD28c zgPJqoOWXX8D0EfsKX32zUGxUfbh7tssI/07NGMts6wQiyA/DAWF7oboGVlp87GRif1+ 59sQ== X-Gm-Message-State: AOAM531n0uZjlDXwY7ydrWudfrafzgVlir1YxqAhyJOwFGEV2hPR+8FV roWPXKNAEPJRr6bnXoeNruNat2f4g8/gXQ== X-Received: by 2002:a05:6808:23c9:: with SMTP id bq9mr502082oib.138.1644878538437; Mon, 14 Feb 2022 14:42:18 -0800 (PST) Received: from localhost.localdomain ([186.136.131.95]) by smtp.gmail.com with ESMTPSA id a8sm13199885otj.47.2022.02.14.14.42.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 14:42:18 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Feb 2022 19:41:54 -0300 Message-Id: <20220214224156.39862-4-jamrial@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220214224156.39862-1-jamrial@gmail.com> References: <20220214224156.39862-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/6] ffmpeg: don't skip packets before a keyframe was seen if a bsf with delay is used 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Wvv7ZRh51pNT A keyframe could be buffered in the bsf and not be output until more packets had been fed to it. Signed-off-by: James Almer --- fftools/ffmpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 6aa0986f02..48d9016b4c 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2026,7 +2026,8 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p } if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) && - !ost->copy_initial_nonkeyframes) + !ost->copy_initial_nonkeyframes && + !(ost->bsf_ctx && ost->bsf_ctx->filter->capabilities & AV_BSF_CAP_DELAY)) return; if (!ost->frame_number && !ost->copy_prior_start) {