mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Fixed time code reading in format "USF" - thx Thomas L :)
This commit is contained in:
parent
c021a2902c
commit
9b3f3f64b1
@ -94,13 +94,21 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
string[] parts = code.Split(new[] { ':', '.', ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
//00:00:07:12
|
||||
if (parts.Length == 1)
|
||||
{
|
||||
return new TimeCode(0, 0, int.Parse(code), 0); // seconds only
|
||||
}
|
||||
if (parts.Length == 2)
|
||||
{
|
||||
return new TimeCode(0, 0, int.Parse(parts[0]), int.Parse(parts[1])); // seconds + ms
|
||||
}
|
||||
|
||||
//00:00:07:120
|
||||
string hour = parts[0];
|
||||
string minutes = parts[1];
|
||||
string seconds = parts[2];
|
||||
string frames = parts[3];
|
||||
|
||||
return new TimeCode(int.Parse(hour), int.Parse(minutes), int.Parse(seconds), FramesToMillisecondsMax999(int.Parse(frames)));
|
||||
string ms = parts[3];
|
||||
return new TimeCode(int.Parse(hour), int.Parse(minutes), int.Parse(seconds), int.Parse(ms));
|
||||
}
|
||||
|
||||
public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)
|
||||
|
Loading…
Reference in New Issue
Block a user