>24hr Duration handling added in FFMpegArgumentProcessor

This commit is contained in:
Ashish 2024-07-01 19:18:34 +10:00
parent eb221c3e49
commit 06b9667991
2 changed files with 3 additions and 1 deletions

View file

@ -80,6 +80,8 @@ public void PacketAnalysisAudioVideo_Sync()
[DataRow("05:12:59.177", 0, 5, 12, 59, 177)] [DataRow("05:12:59.177", 0, 5, 12, 59, 177)]
[DataRow("149:07:50.911750", 6, 5, 7, 50, 911)] [DataRow("149:07:50.911750", 6, 5, 7, 50, 911)]
[DataRow("00:00:00.83", 0, 0, 0, 0, 830)] [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) public void MediaAnalysis_ParseDuration(string duration, int expectedDays, int expectedHours, int expectedMinutes, int expectedSeconds, int expectedMilliseconds)
{ {
var ffprobeStream = new FFProbeStream { Duration = duration }; var ffprobeStream = new FFProbeStream { Duration = duration };

View file

@ -263,7 +263,7 @@ private void ErrorData(object sender, string msg)
return; return;
} }
var processed = TimeSpan.Parse(match.Groups[1].Value, CultureInfo.InvariantCulture); var processed = MediaAnalysisUtils.ParseDuration(match.Groups[1].Value);
_onTimeProgress?.Invoke(processed); _onTimeProgress?.Invoke(processed);
if (_onPercentageProgress == null || _totalTimespan == null) if (_onPercentageProgress == null || _totalTimespan == null)