Commit Graph

1 Commits

Author SHA1 Message Date
Moritz Bunkus
8696db7e11 MPEG-2 parser: re-write timestamping code not to rely on exact sequence number progression
The old code was calculating an expected sequence number. As soon as
that sequence number was matched with frames, all previous frames would
be timestamped.

This method is problematic if the actual sequence numbers don't follow
the expected progression.

The new code is much simpler. As soon as an I frame is encountered (or
at the end of the file) the queued frames are first sorted by their
sequence number, then timestamped, and lastly sorted back into their
decoding order.

This fixes #1162 and most likely others (see #1145, #1099 et. al.).
2015-04-11 14:33:45 +02:00