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

#31
This commit is contained in:
Tuğrul Elmas 2020-01-29 13:54:30 +03:00 committed by GitHub
parent 7b9b8afac8
commit d599592084
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)