lavf/srtdec: rewrite parsing logic