Optimized input processing of both .srt and .sub files.