From a87b7da308921c42728b4d1f06f8e1fb0e37141d Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Wed, 16 Nov 2022 09:29:59 +0100 Subject: [PATCH] mpegts: Check is program is identical before updating There is no need to update the program if it's identical :) Part-of: --- subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c b/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c index 4a095ad..d18475b 100644 --- a/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c +++ b/subprojects/gst-plugins-bad/gst/mpegtsdemux/mpegtsbase.c @@ -1204,6 +1204,10 @@ mpegts_base_apply_pmt (MpegTSBase * base, GstMpegtsSection * section) if (G_UNLIKELY (old_program == NULL)) goto no_program; + if (G_UNLIKELY (mpegts_base_is_same_program (base, old_program, section->pid, + pmt))) + goto same_program; + if (base->streams_aware && mpegts_base_is_program_update (base, old_program, section->pid, pmt)) { GST_FIXME ("We are streams_aware and new program is an update"); @@ -1212,10 +1216,6 @@ mpegts_base_apply_pmt (MpegTSBase * base, GstMpegtsSection * section) goto beach; } - if (G_UNLIKELY (mpegts_base_is_same_program (base, old_program, section->pid, - pmt))) - goto same_program; - /* If the current program is active, this means we have a new program */ if (old_program->active) { MpegTSBaseClass *klass = GST_MPEGTS_BASE_GET_CLASS (base); -- 2.7.4