Silence cast warning
Use ConvertCharToBSTR helper function for chapter names
Use TS discontinuity logic for RealMedia

Fixes a few cases of wrong durations and gaps in the files.
Fix AVI codecs in MKV which require a bit depth value to be set.