From patchwork Wed Jun 15 05:34:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 36234 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1a22:b0:84:42e0:ad30 with SMTP id cj34csp169474pzb; Tue, 14 Jun 2022 22:35:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQJw6VTu2Itbl0vHp3aIYSi43Fx6lmL46C4jPsg6ieeyze0Pip8dsvQpssOFp4ToshqFyn X-Received: by 2002:a17:906:3793:b0:702:eea9:843a with SMTP id n19-20020a170906379300b00702eea9843amr7280451ejc.465.1655271300019; Tue, 14 Jun 2022 22:35:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655271300; cv=none; d=google.com; s=arc-20160816; b=BxuClAEy0sfUDbigrDh3p5X+9pMNBhZv8ZAay8ppFK5srEZPOF1/S7YvRILL7IBgYw Zpd64VroU9ZG8fAOJIXolteVNLWLML29HBupL/u8m5kc/IQuv4u7qGSKqhB80j/En7sL lZ78BEAweN2k9m8F29Zita/Fpb53lWxn8mG4e5qbMpePZG+omKSLjzQ3jyuyXGGsWnZo MTFyGnENMfa5Z815QoUxRl0hSheLiIqEHGKR3UYWyF+rL3FdrBPLiw5gimx2J940KyG3 Asq5rKeTKe0wIiD1QFdo0PP8VH7dj+9EWKvrqim9cCPvOhSZl8oCQ4xh6c2V8j+6DZMN ojsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=mafln/pfR77YE4SRyl5R/WaYvVu7rtybLEzf/tb9uqI=; b=sKLhOSZWty9bKiC4XAbq2HfKY2AYZ76wz5Xz+9fN9x3JaoO7JwjyE6Sj8MJfiw1Zg7 HESsB2JkNVIP/FdjGnDwYEa8SVMN3ECSRWb8N12X6RreWhxRYLcH/8sFF5ZFaXq/SanY IpqRKUFsR0RtuTKAwgVk6nXC0naGjnyz9P0/WKbYlSIRbN8zv6hFW5oNICW3pD1+Mux/ aRL03rS9KomEj3sfcpOFDxKaYA02sSOx2TOnVoMQp+sVCHPLyfkRukpGJp+LyOpHVwL7 T4tPlEqdbzKSKvvCLTtYeGn9jiP78+U/P5BQdRmgWdmYofZRbxj8NVoaRRH1pRwMKXbS aGFw== ARC-Authentication-Results: i=1; mx.google.com; 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 hq4-20020a1709073f0400b00711f823b368si1807914ejc.669.2022.06.14.22.34.59; Tue, 14 Jun 2022 22:35:00 -0700 (PDT) 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; 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 4BB4C68B6AF; Wed, 15 Jun 2022 08:34:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9C34D68B4F1 for ; Wed, 15 Jun 2022 08:34:50 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id DC51BE71E2; Wed, 15 Jun 2022 07:34:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WXtsm_wIMpLL; Wed, 15 Jun 2022 07:34:48 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 5E147E6C0B; Wed, 15 Jun 2022 07:34:48 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Jun 2022 07:34:42 +0200 Message-Id: <20220615053442.8300-1-cus@passwd.hu> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/mpegts: remove obsolate hacks for detecting streams with bad PMTs 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 Cc: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 7yEsL/zQMBHQ Ffmpeg/ffprobe/ffplay sets scan_all_pmts to 1 when finding the streams, that should be enough to handle files for which some early PMTs miss some streams. Fixes ticket #9782. Signed-off-by: Marton Balint --- libavformat/mpegts.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 6e761c07f1..8a3436f2be 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2870,16 +2870,8 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet, int64_t pos) break; } if (i == ts->nb_prg && ts->nb_prg > 0) { - int types = 0; - for (i = 0; i < ts->stream->nb_streams; i++) { - AVStream *st = ts->stream->streams[i]; - if (st->codecpar->codec_type >= 0) - types |= 1<codecpar->codec_type; - } - if ((types & (1< 100000) { - av_log(ts->stream, AV_LOG_DEBUG, "All programs have pmt, headers found\n"); - ts->stream->ctx_flags &= ~AVFMTCTX_NOHEADER; - } + av_log(ts->stream, AV_LOG_DEBUG, "All programs have pmt, headers found\n"); + ts->stream->ctx_flags &= ~AVFMTCTX_NOHEADER; } }