Fix WebVttSub not be able to parse string without ms (#473)
This commit is contained in:
parent
9c49fce4ff
commit
dd30bd99f9
|
@ -201,10 +201,14 @@ namespace N_m3u8DL_RE.Common.Entity
|
||||||
}
|
}
|
||||||
|
|
||||||
str = str.Replace(',', '.');
|
str = str.Replace(',', '.');
|
||||||
var ms = Convert.ToInt32(str.Split('.').Last());
|
long time = 0;
|
||||||
var o = str.Split('.').First();
|
string[] parts = str.Split('.');
|
||||||
var t = o.Split(':').Reverse().ToList();
|
if (parts.Length > 1)
|
||||||
var time = 0L + ms;
|
{
|
||||||
|
time += Convert.ToInt32(parts.Last());
|
||||||
|
str = parts.First();
|
||||||
|
}
|
||||||
|
var t = str.Split(':').Reverse().ToList();
|
||||||
for (int i = 0; i < t.Count(); i++)
|
for (int i = 0; i < t.Count(); i++)
|
||||||
{
|
{
|
||||||
time += (long)Math.Pow(60, i) * Convert.ToInt32(t[i]) * 1000;
|
time += (long)Math.Pow(60, i) * Convert.ToInt32(t[i]) * 1000;
|
||||||
|
|
Loading…
Reference in New Issue