Rewrite srt parser in more cleaner way. Fix a crash in ass parser.