FFProbe: add format provider to correctly parse the video's duration

#31 

Former-commit-id: d599592084
This commit is contained in:
Tuğrul Elmas 2020-01-29 13:54:30 +03:00 committed by GitHub
parent a5aad904e7
commit ce16d9103c

View file

@ -79,7 +79,7 @@ private VideoInfo ParseVideoInfoInternal(VideoInfo info, string probeOutput)
double videoSize = 0d; double videoSize = 0d;
double audioSize = 0d; double audioSize = 0d;
var duration = TimeSpan.FromSeconds(double.TryParse((video ?? audio).Duration, out var output) ? output : 0); var duration = TimeSpan.FromSeconds(double.TryParse((video ?? audio).Duration, NumberStyles.Any, CultureInfo.InvariantCulture, out var output) ? output : 0);
info.Duration = duration.Subtract(TimeSpan.FromMilliseconds(duration.Milliseconds)); info.Duration = duration.Subtract(TimeSpan.FromMilliseconds(duration.Milliseconds));
if (video != null) if (video != null)