diff options
author | John Stebbins <[email protected]> | 2018-11-07 09:31:35 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2018-11-07 09:31:35 -0800 |
commit | 08ba3e6ba45d03dbfddecb8ed74e0e63142e5eb6 (patch) | |
tree | 9cc8495f1f7e1fd74cf7838a6676d0fabf59c766 /libhb/decsrtsub.c | |
parent | 48abfc4c6699bd455e49dc9a621aaaf3f47ce894 (diff) |
decsrtsub: support timecodes that use '.' for fractions
The convention is to use ',' for fractions in SRT files. But
opensubtitles.com is distributing files that use '.'
Diffstat (limited to 'libhb/decsrtsub.c')
-rw-r--r-- | libhb/decsrtsub.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libhb/decsrtsub.c b/libhb/decsrtsub.c index d5c17c27e..f6482525c 100644 --- a/libhb/decsrtsub.c +++ b/libhb/decsrtsub.c @@ -225,7 +225,13 @@ read_time_from_string( const char* timeString, struct start_and_end *result ) &houres2, &minutes2, &seconds2, &milliseconds2); if (scanned != 8) { - return 0; + scanned = sscanf(timeString, "%ld:%ld:%ld.%ld --> %ld:%ld:%ld.%ld\n", + &houres1, &minutes1, &seconds1, &milliseconds1, + &houres2, &minutes2, &seconds2, &milliseconds2); + if (scanned != 8) + { + return 0; + } } result->start = milliseconds1 + seconds1*1000 + minutes1*60*1000 + houres1*60*60*1000; |