Cosmetics
Cosmetics: Tidy up abuse of #defines
Use get_pcr more accurately.
Tidy up main file
Separate bitstream check
First set of patches to improve muxing to output data which is equally sized.

May be buggy under some conditions.
Fix crash during mux
Fix more issues with the PCR
Make video muxing be tighter towards the HRD model
Revert to the old buffering system for the time being.
The "correct" one has some issues
Write discontinuity indicator flag when starting a new TS. Can't do any harm anyway.
Free buffered frames when closing ts output
Free more contexts when closing the ts writer
Clarify why we write a PCR at the beginning of every video PES
Fix CRLF
Only calculate earliest arrival times once
Fix bug with non-video muxing
Correct further issues with random_access_indicator flag
Fix bug with first MPEG-2 level being zero
Prefix some constants