tvheadend/tvheadend — pull request #255 by linuxstb (2013-02-24 14:22:31+00:00)
Title: Passthrough original PAT/PMT packets to the passthrough muxer

This is a work-in-progress and is not yet ready for pulling.

The passthrough muxer currently generates its own PAT/PMT packets and inserts these into the output stream at regular intervals. This PR replaces that code with code which includes the original PAT/PMT packets from the DVB broadcast, in their original positions.

A new DVR config option allows the user to specify if these are passed through unmodified, or if they are rewritten to exclude services (in the case of the PAT) or streams (in the case of the PMT) not included in the output stream. This option is for cases where the user needs to use players or processing tools which expect a more compliant PAT/PMT.

However, this rewriting is not 100% robust, and we may decide a better option is to just rebuild the PAT/PMT as we were doing in the past for the "rewrite" case.

NOTE: This code also currently only works when the adapter is running in Full Mode - in filtered mode, no TS filters are currently set for the PAT and PMT packets, so the resulting transport stream will be missing them.

One way to solve that is to change the filtered mode code to also use TS filters and perform section parsing in software. The advantage of this would be more consistent behaviour between raw and filtered mode, but it may use more PID filters, and (at least when using the passthrough muxer) would prevent tvheadend temporarily pausing a filter for the active PMT and reusing it for something else (e.g. EIT scanning).