fix hls segmenter bug with unknown packet duration

This commit is contained in:
Jason Dove
2022-02-11 18:37:02 -06:00
parent ab1f294c1f
commit 640fed0a43
2 changed files with 7 additions and 1 deletions
+2
View File
@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
- Fix `HLS Segmenter` bug when source video packet contains no duration (`N/A`)
## [0.4.1-alpha] - 2022-02-10
### Fixed
@@ -6,7 +6,11 @@ public record PtsAndDuration(long Pts, long Duration)
{
string[] split = ffprobeLine.Split("|");
var left = long.Parse(split[0]);
var right = long.Parse(split[1]);
if (!long.TryParse(split[1], out long right))
{
// some durations are N/A, so we have to guess at something
right = 10_000;
}
return new PtsAndDuration(left, right);
}
}