Browse Source

fix hls segmenter bug with unknown packet duration

pull/631/head
Jason Dove 4 years ago
parent
commit
640fed0a43
  1. 2
      CHANGELOG.md
  2. 6
      ErsatzTV.Application/Streaming/PtsAndDuration.cs

2
CHANGELOG.md

@ -4,6 +4,8 @@ All notable changes to this project will be documented in this 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
ErsatzTV.Application/Streaming/PtsAndDuration.cs

@ -6,7 +6,11 @@ public record PtsAndDuration(long Pts, long Duration) @@ -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);
}
}

Loading…
Cancel
Save