fix hls segmenter bug with unknown packet duration
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user