From patchwork Tue Dec 29 19:19:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 24677 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 3FB1E44A80B for ; Tue, 29 Dec 2020 21:19:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1322668A67C; Tue, 29 Dec 2020 21:19:54 +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 5BE29687F78 for ; Tue, 29 Dec 2020 21:19:48 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 11BDCE4B1D; Tue, 29 Dec 2020 20:19:48 +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 Dh9_LAWXdiHh; Tue, 29 Dec 2020 20:19:46 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 0C10EE4A3D; Tue, 29 Dec 2020 20:19:46 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 29 Dec 2020 20:19:33 +0100 Message-Id: <20201229191933.17281-1-cus@passwd.hu> X-Mailer: git-send-email 2.26.2 In-Reply-To: <03cf0b3b-ca37-9163-7658-9889c48004f5@gmail.com> References: <03cf0b3b-ca37-9163-7658-9889c48004f5@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 6/6] avformat: remove some mpegts details from AVStream X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" These fields were added to support -merge_pmt_versions, but the mpegts demuxer is also keeping track its programs internally, so that should be a better place to handle it. Also it is not a very good idea to keep fields like program_num or pmt_stream_idx in an AVStream, because a single stream can be part of multiple programs, multiple PMTs, so the stream attributes can refer to any program the stream is part of. Since they are not part of public API, lets simply remove them, or rather replace them with placeholders for ABI compatibility with libavdevice. Signed-off-by: Marton Balint --- libavformat/avformat.h | 12 ++++++------ libavformat/mpegts.c | 9 --------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 4865c56cc3..523cf34d55 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1096,12 +1096,12 @@ typedef struct AVStream { */ int stream_identifier; - /** - * Details of the MPEG-TS program which created this stream. - */ - int program_num; - int pmt_version; - int pmt_stream_idx; +#if LIBAVFORMAT_VERSION_MAJOR < 59 + // kept for ABI compatibility only, do not access in any way + int unused8; + int unused9; + int unused10; +#endif /** * An opaque field for libavformat internal usage. diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 9a3fd56ece..b9a3152e81 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -2406,9 +2406,6 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (!pes->st) goto out; pes->st->id = pes->pid; - pes->st->program_num = h->id; - pes->st->pmt_version = h->version; - pes->st->pmt_stream_idx = i; } st = pes->st; } else if (is_pes_stream(stream_type, prog_reg_desc)) { @@ -2428,9 +2425,6 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (!st) goto out; st->id = pes->pid; - st->program_num = h->id; - st->pmt_version = h->version; - st->pmt_stream_idx = i; } } else { int idx = ff_find_stream_index(ts->stream, pid); @@ -2445,9 +2439,6 @@ static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (!st) goto out; st->id = pid; - st->program_num = h->id; - st->pmt_version = h->version; - st->pmt_stream_idx = i; st->codecpar->codec_type = AVMEDIA_TYPE_DATA; if (stream_type == 0x86 && prog_reg_desc == AV_RL32("CUEI")) { mpegts_find_stream_type(st, stream_type, SCTE_types);