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.