From patchwork Mon Nov 22 00:07:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 31520 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp6129829iob; Sun, 21 Nov 2021 16:08:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVTxPHG+xsNm/ESF61f879WM7Xe8MqAGQ+QVEmNpw9sdpKJmqAfOdL1sBquZgOFBWi/7CI X-Received: by 2002:a17:906:18b2:: with SMTP id c18mr35694427ejf.403.1637539697918; Sun, 21 Nov 2021 16:08:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637539697; cv=none; d=google.com; s=arc-20160816; b=CiDx7cbPA4V0BY/p5THNgtozZn3OLBNB1dmjmOcgeHFjVdUmmi8rkvGyvqHUw2FgpA B0yyyKj34Ovch/gqykyqTw3o6/8dwBvlDfn57arHExLyoafbpZFLTF97zIzyyhg7h1q0 cOu2vs6ytXdh0TQnw6udiJsKkb1qqkDWU3JGEFCVca+iMLHsfY4vctuxZWBOB5UE8cpe hEPSuQJrAqcfI3yKNIcAAX3mbbudQdnnC12UKJERYBQjo5dEkm3TRS+N/etqecGd9AET CeJI4DFNyyMAChQBz/yj/gyN8z1gUpnYQaMjyAqSNn68MFqyHEWDA+WNu67PpAfS5ugt P3BA== 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=h/dt6SMn67MHqmwr2dpVV0WpWmVYZ0mkp8DvpCIKl/8=; b=uICmC2bmsDEE6k+iChxyI++04F992P3tu2Lak4wuysq8qz7QLaBQBhrPxOYS0hlyG3 QnS8xozW0QfyUHA43dNK2Kf3JQQ3kDEuf+1A5IXEn4xUNZEJ0QVmy1qVG/GwfwS4uXPn o2acqPP/23IC6aKIc6qz4bzQqvjTgpo/dhvisFRnfJD1eg7JW60nXZgwglT2JkU9GjmH JC/28r4w0/WP299QH7P8eFWzpqiH1FJFptOwb7ZBpb5lsOY0/SnA+p6AOUZ+PYfoAmWX L+nkRiXbwO/kyXuulKwdXQEX9M2hbk9oNNFlUNG2BZRx+szVcw579zj4XKwTH+gyZTRm n1Jw== 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 o12si23511317ejy.249.2021.11.21.16.08.17; Sun, 21 Nov 2021 16:08:17 -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; 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 3005E68A973; Mon, 22 Nov 2021 02:08:13 +0200 (EET) 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 CC23E68A841 for ; Mon, 22 Nov 2021 02:08:06 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 69765E6390; Mon, 22 Nov 2021 01:08:05 +0100 (CET) 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 3XUpIEGaXvuV; Mon, 22 Nov 2021 01:08:02 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 585CDE638F; Mon, 22 Nov 2021 01:08:02 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 22 Nov 2021 01:07:58 +0100 Message-Id: <20211122000758.6128-1-cus@passwd.hu> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/mpegts: fix stream index in verbose log message 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: DYB2KSbS36lR Signed-off-by: Marton Balint --- libavformat/mpegts.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 29a267436f..36ab7ab3af 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2238,11 +2238,10 @@ static AVStream *find_matching_stream(MpegTSContext *ts, int pid, unsigned int p int stream_identifier, int pmt_stream_idx, struct Program *p) { AVFormatContext *s = ts->stream; - int i; AVStream *found = NULL; if (stream_identifier) { /* match based on "stream identifier descriptor" if present */ - for (i = 0; i < p->nb_streams; i++) { + for (int i = 0; i < p->nb_streams; i++) { if (p->streams[i].stream_identifier == stream_identifier) if (!found || pmt_stream_idx == i) /* fallback to idx based guess if multiple streams have the same identifier */ found = s->streams[p->streams[i].idx]; @@ -2255,7 +2254,7 @@ static AVStream *find_matching_stream(MpegTSContext *ts, int pid, unsigned int p av_log(ts->stream, AV_LOG_VERBOSE, "re-using existing %s stream %d (pid=0x%x) for new pid=0x%x\n", av_get_media_type_string(found->codecpar->codec_type), - i, found->id, pid); + found->index, found->id, pid); } return found;