Handling PTS rollovers
While we're talking about PTS over in #15 -- my understanding is that MPEGTS can actually have PTS rollovers after a few weeks of a constant stream (since PTS eventually does max out, no matter how many bits the demuxer can handle!)
Right now there is logic to explicitly prevent pts from decreasing. I'm not sure if that is part of other demuxers out there / wonder if maybe that logic should be removed in order to support those rare rollovers.
Yes, that is accurate. If I Recall Correctly, that was added to handle a possible issue with mis-ordered packets. If you want to try deleting that line, testing, and check that nothing new breaks, that's cool, go ahead and submit a PR. If something does break, it might just need an extra bit of logic to explicitly handle resets; e.g., check if the difference is so large that it would not have happened by accident.
That makes sense.
Rather than remove that safeguard it seems reasonable to defensively throw in the threshold logic to allow for that use case without weakening the out-of-order protections. It's nearing the end of my workday but between this and the other I'll hopefully finally have something to contribute to this project soon!