mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Refact of WebVTT (minor)
This commit is contained in:
parent
a45ef8cd86
commit
3792a913d2
@ -263,12 +263,12 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
break;
|
||||
}
|
||||
}
|
||||
var parts = localSb.ToString().Split(new [] { ':', '.' });
|
||||
if (parts != null && parts.Length == 3)
|
||||
var parts = localSb.ToString().Split(':', '.');
|
||||
if (parts.Length == 3)
|
||||
{
|
||||
parts = ("00:" + localSb).Split(new [] { ':', '.' });
|
||||
parts = ("00:" + localSb).Split(':', '.');
|
||||
}
|
||||
if (parts != null && parts.Length == 4)
|
||||
if (parts.Length == 4)
|
||||
{
|
||||
subtractSeconds = DecodeTimeCodeMsFourParts(parts).TotalSeconds;
|
||||
}
|
||||
@ -290,10 +290,9 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
|
||||
if (tsSb.Length > 0)
|
||||
{
|
||||
long number;
|
||||
if (long.TryParse(tsSb.ToString(), out number))
|
||||
if (long.TryParse(tsSb.ToString(), out var number))
|
||||
{
|
||||
var seconds = number / Configuration.Settings.SubtitleSettings.WebVttTimescale - subtractSeconds;
|
||||
var seconds = (double)number / Configuration.Settings.SubtitleSettings.WebVttTimescale - subtractSeconds;
|
||||
if (seconds > 0 && seconds < 90000) // max 25 hours - or wrong timescale
|
||||
{
|
||||
return seconds;
|
||||
|
Loading…
Reference in New Issue
Block a user