If you happen to receive a DVB stream that contains a program with no PCR
transmitted (PCR PID == 8191), then the calloc'ed pmt->pcrpid is left untouched
(=0), but still referred to while selecting PIDs for this program's output
substream. This results in the original PMT (PID 0) being included in the
output, in addition to a new PMT (also PID 0) synthesized for the substream.
The patch corrects the problem for me by not avoiding the pmt->pcrpid=pmt_pcr(s)
assignment in the PID_MAX case. The PID_MAX elementary stream, as possibly
consisting of empty placeholder packets only, is ignored while composing the
output anyway.
I reported the issue to the packet author in 2008-11-05, providing two different
solutions (the other was initializing the pmt->pcrpid with PID_MAX right after
calloc), but did not get him convinced of it being a problem. Found the bug
still present in his git tree, I decided to file a bug report here.
Thanks,
Janusz