From 5d7093a54ed23d76f9f6f5638a39a40b4640f90d Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Thu, 29 Oct 2015 02:56:14 +0200 Subject: Interpret timestamps with negative components more obviously Keep all components signed, allowing for timestamps like 00:01:-05.00 to denote 55 seconds. This matches the behavior of VSFilter. --- libass/ass.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libass') diff --git a/libass/ass.c b/libass/ass.c index 094cc92..1a2a364 100644 --- a/libass/ass.c +++ b/libass/ass.c @@ -224,9 +224,9 @@ static void set_default_style(ASS_Style *style) static long long string2timecode(ASS_Library *library, char *p) { - unsigned h, m, s, ms; + int h, m, s, ms; long long tm; - int res = sscanf(p, "%u:%u:%u.%u", &h, &m, &s, &ms); + int res = sscanf(p, "%d:%d:%d.%d", &h, &m, &s, &ms); if (res < 4) { ass_msg(library, MSGL_WARN, "Bad timestamp"); return 0; -- cgit v1.2.3