From patchwork Wed Jan 24 08:16:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45784 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:120f:b0:199:de12:6fa6 with SMTP id v15csp1130560pzf; Wed, 24 Jan 2024 00:21:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmqGDvf0xIM6W8bTMfzx8Kxv7Tot59kl5VpgrydeReMVYtikgc5xGyfJ+0MGi3P79oeUKk X-Received: by 2002:a17:907:c209:b0:a30:e1b8:1167 with SMTP id ti9-20020a170907c20900b00a30e1b81167mr365716ejc.231.1706084480300; Wed, 24 Jan 2024 00:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706084480; cv=none; d=google.com; s=arc-20160816; b=Rsl8vipN6Tc2v6wGiTC90TuLSrAy7caD37zr+MdWoSG/MmBNzvtt5Qwjy7xvFLeM0d 5JM7JGfy9MUACdMAB5DSVjxrbVNOS0T+WnLFlatjNeT2y4Nz5lXQBEJyVr5DDsBoPGoq AleA88fkPQBI6bvTzhz7aF/SjVvUdQeH072LkBQCcNR9lEwLI9eF7xmq6XLLdrE1VQq3 XKCKCpB4O2M/PAjTXxSMKdB59rVXPlcIrMC6JHJrY+TEgouH5Um9Mk3a4Pstd0qTDEsN PqtMS7WG7r8LG7JnqYJ1Fkw57h3jKS1KOPD50pH+zKjModqO0qUh0HSBUn6oUO8Ril1b D7Lw== 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=OCmzS/kD3nrOGcaUD9xgJj1m98Z2aEKzJbfIYmz9q60=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=NeB700nZWjsKx9GGLr9t0zDDlhZ4kYvSYPVhFChAqW7aqgU9vWDxwHReZKjUD23LIJ dI1FOmqrX6iwX1JaK1MhsweohdOXvNaOZoD5EBGu55xEYbMBOxVrB0NzgWRzRmOm8E0/ /ira62tmS+2HlrMvq0Zcgu+4S3JNHpZpHP22iuQq9Hk3/y2Pnh8WvZLoQ/dxHLpZBrtC hn5cRyxaxPnMWx0pHdHo9VN5/BRM5ve5aorvqfyXFRvJ+E5qQimWRBC5TPnqkFGgo3qP ZMD08qPgHEmzD4R6Wui249H2GiYWlpoSVbcfKpEfOzd/ETO6hMVUty/+6rcSaz+513Q5 OAHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=WKtuPauU; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m27-20020a170906161b00b00a2aa3dc64d7si12536417ejd.95.2024.01.24.00.21.19; Wed, 24 Jan 2024 00:21:20 -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=@khirnov.net header.s=mail header.b=WKtuPauU; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 592B468D1EA; Wed, 24 Jan 2024 10:17:56 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6E5A368D13D for ; Wed, 24 Jan 2024 10:17:26 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=WKtuPauU; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 9747C1C17 for ; Wed, 24 Jan 2024 09:17:21 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id d5m5B8KNjcdL for ; Wed, 24 Jan 2024 09:17:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1706084239; bh=BpCXtVKx6vt6tGJQlGiDZN5RU2icJ5vxgXlU1WM0jKA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WKtuPauUxFiJMX8ddOlACqkPnS886JUyQ6lTG2DGiwCaNPW3G5hUNocio829hUwMA E+RKEyxvXlk+dppiWGuF+VQbPGayY6Z4r+Osy9u94Hb6lFKLikOfiQlanqKglUKjmZ hAUU7HgVk0Fj8gVc8bOSOkGVxEfw5PRcYQQTu5H2q65JsbGv7fOk/I6gZZPCCsdUr5 6lHn5O9EkvTamfS489Kb5evLoeaUeIBiLHmQHoROjXi8jJZtIgKqdE7vp6aNZhhx2R BUJsjgz4mI2msHSocq/+ieALdOeThAwcA4x2Iiojx4xZ7VTydaYyOsoexVqE+dWKLQ HUiXKSkgtNxtw== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 9B9711A0C for ; Wed, 24 Jan 2024 09:17:19 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 76B053A0819 for ; Wed, 24 Jan 2024 09:17:19 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Wed, 24 Jan 2024 09:16:38 +0100 Message-ID: <20240124081702.4759-8-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240124081702.4759-1-anton@khirnov.net> References: <20240124081702.4759-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/31] fftools/ffmpeg_dec: drop useless and racy code 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: AZ4BGuSezfzv Setting demuxer's video_delay from the decoder cannot accomplish anything meaningful and is racy, as they run in different threads. --- fftools/ffmpeg_dec.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index 4a59a4b392..baaba966c6 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -263,21 +263,6 @@ static int video_frame_process(InputStream *ist, AVFrame *frame) { DecoderPriv *dp = dp_from_dec(ist->decoder); - // The following line may be required in some cases where there is no parser - // or the parser does not has_b_frames correctly - if (ist->par->video_delay < dp->dec_ctx->has_b_frames) { - if (dp->dec_ctx->codec_id == AV_CODEC_ID_H264) { - ist->par->video_delay = dp->dec_ctx->has_b_frames; - } else - av_log(dp->dec_ctx, AV_LOG_WARNING, - "video_delay is larger in decoder than demuxer %d > %d.\n" - "If you want to help, upload a sample " - "of this file to https://streams.videolan.org/upload/ " - "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)\n", - dp->dec_ctx->has_b_frames, - ist->par->video_delay); - } - if (dp->dec_ctx->width != frame->width || dp->dec_ctx->height != frame->height || dp->dec_ctx->pix_fmt != frame->format) {