[MPlayer-dev-eng] [patch] RT subtitle timestamp parsing buggy

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat May 24 20:05:00 CEST 2014


On Fri, Mar 21, 2014 at 05:16:35PM +0200, hhaamu at gmail.com wrote:
> 1) sscanf sets a1, a2 etc even when the whole line does not match. The
> lines that try to parse begin/end tags will partially match and set
> those variables, leading to faulty timestamps. The variables should be
> reset to zero after each match attempt.

That whole code is seriously horrible and scary.
I'm generally for minimal changes but in this case I'm not sure
that's the best way to go.

> 2) The line that tries matching for mm:ss timestamps actually matches
> more than it is supposed to. The mm:ss.ff and hh:mm:ss.ff lines are
> never run.

I think they are not supposed to match at all.
It seems to me what is really missing is a check for plen > 0...
Except for the fact that the text output is correct, which would imply
that plen was actually set as if there had been a match.
Which should not be possible as the format string includes the quotation
marks around the time.
Maybe the tags just get stripped by some other code though...
I sent an alternative two-patch series which seems to work for me.


More information about the MPlayer-dev-eng mailing list