Skip to content
Permalink
Browse files

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 '.'
  • Loading branch information...
jstebbins committed Nov 7, 2018
1 parent 48abfc4 commit 08ba3e6ba45d03dbfddecb8ed74e0e63142e5eb6
Showing with 7 additions and 1 deletion.
  1. +7 −1 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;

0 comments on commit 08ba3e6

Please sign in to comment.
You can’t perform that action at this time.