From 06b966799160b2ffe863c83e083fef0e955897e1 Mon Sep 17 00:00:00 2001 From: Ashish <156739271+alahane-techtel@users.noreply.github.com> Date: Mon, 1 Jul 2024 19:18:34 +1000 Subject: [PATCH] >24hr Duration handling added in FFMpegArgumentProcessor --- FFMpegCore.Test/FFProbeTests.cs | 2 ++ FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/FFMpegCore.Test/FFProbeTests.cs b/FFMpegCore.Test/FFProbeTests.cs index a507078..bb7aec8 100644 --- a/FFMpegCore.Test/FFProbeTests.cs +++ b/FFMpegCore.Test/FFProbeTests.cs @@ -80,6 +80,8 @@ public void PacketAnalysisAudioVideo_Sync() [DataRow("05:12:59.177", 0, 5, 12, 59, 177)] [DataRow("149:07:50.911750", 6, 5, 7, 50, 911)] [DataRow("00:00:00.83", 0, 0, 0, 0, 830)] + [DataRow("24:00:00.83", 1, 0, 0, 0, 830)] + [DataRow("240:00:00.83", 10, 0, 0, 0, 830)] public void MediaAnalysis_ParseDuration(string duration, int expectedDays, int expectedHours, int expectedMinutes, int expectedSeconds, int expectedMilliseconds) { var ffprobeStream = new FFProbeStream { Duration = duration }; diff --git a/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs b/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs index 27237d8..4382fcb 100644 --- a/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs +++ b/FFMpegCore/FFMpeg/FFMpegArgumentProcessor.cs @@ -263,7 +263,7 @@ private void ErrorData(object sender, string msg) return; } - var processed = TimeSpan.Parse(match.Groups[1].Value, CultureInfo.InvariantCulture); + var processed = MediaAnalysisUtils.ParseDuration(match.Groups[1].Value); _onTimeProgress?.Invoke(processed); if (_onPercentageProgress == null || _totalTimespan == null)