Some streams have 2 PMT sections in a single TS packet. The first one is "valid"
but doesn't contain/define any streams. That causes an unrecoverable issue when
we try to activate the 2nd (valid) PMT.
Instead of doing that, pre-emptively refuse to process PMT without any streams
present within. We still do post that section on the bus to inform applications.
Fixes #1181
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2310>
+ /* Don't attempt to handle pmt without any streams */
+ if (G_UNLIKELY (pmt->streams->len == 0)) {
+ GST_WARNING ("Skipping PMT without any entries");
+ return TRUE;
+ }
+
program_number = section->subtable_extension;
GST_DEBUG ("Applying PMT (program_number:%d, pid:0x%04x)",
program_number, section->pid);
program_number = section->subtable_extension;
GST_DEBUG ("Applying PMT (program_number:%d, pid:0x%04x)",
program_number, section->pid);