0003660: TsReader problems with PCR rollover


Worlds greatest bot!
March 26, 2007

The handling of PCR rollover in TsReader is incorrect in some cases. Quote from Asselin (who raised the issue originally):

"TsReader has 2 bugs in it when dealing with TS files that have PCR rollover:
1. When you start playback, MediaPortal freezes, HDD light goes solid, and after a while (could be minutes), the file starts playing back.
2. While playing, if you try to skip forward or backward, the HDD light goes solid again, and then after a while, the recording restarts from the beginning.

Problem 0000001 is a bug in TsDuration. It calculates the duration of the TS file by looking for the max PCR in the TS file before the rollover happens, and does this by a sequential (!) backwards (!!) file search. All that is unnecessary-- the code should just use a constant value (the MAX possible PCR of all binary 1s) as the value.

Problem 0000002 is a bug in TsFileSeek. Here, there's a section of code specifically for scanning a TS file with PCR rollover in it, and there's an if() statement where the logic is backwards. Fixing the if() fixes the problem, but beyond that, there's a whole other algorithm in it to deal with skipping around in TS files with PCR rollover that is unnecessary. The standard binary search algorithm works just fine, and is in fact faster."


Open the issue in Mantis...