mpegts: Provide an option to override the pcr period

Certain hardware demuxer have specific restrictions for PCR periodicity.
matroska: K&R formatting cosmetics
matroska: Factor out write_track from mkv_write_tracks
matroska: Factor out mkv_write_stereo_mode
matroska: Factor out mkv_write_cue_entry
matroska: Move codec-specific functions in a stand-alone file