From 8a2edc6581c0f34a0e9efba146c520cce1410d29 Mon Sep 17 00:00:00 2001 From: Mart Raudsepp Date: Tue, 20 Sep 2022 23:31:45 +0300 Subject: [PATCH] tsdemux: Don't trigger a program change when falling back to ignore-pcr behaviour Since commit a79a756b79aa1675e we could change to ignore-pcr automatically at 500ms into a live stream when no PCR is seen by then. However the stream counting in program change detection was wrongly considering ignore-pcr programs to have a separate PCR PID, even though we are actually ignoring the PCR PID completely, resulting in an erroneous program switch getting triggered from the different stream count. This in turn would send an EOS and switch out the pads for what actually is still the same program, while we intended to simply apply a workaround for broken encoders. Part-of: --- subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c b/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c index 01bc68e2f4..981019360f 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c @@ -847,8 +847,8 @@ mpegts_base_is_same_program (MpegTSBase * base, MpegTSBaseProgram * oldprogram, sawpcrpid = TRUE; } - /* If the pcr is not shared with an existing stream, we'll have one extra stream */ - if (!sawpcrpid) + /* If we have a PCR PID and the pcr is not shared with an existing stream, we'll have one extra stream */ + if (!sawpcrpid && !base->ignore_pcr) nbstreams += 1; if (nbstreams != g_list_length (oldprogram->stream_list)) {