Browse Source

stop infinite playout building loop (#951)

pull/952/head
Jason Dove 3 years ago committed by GitHub
parent
commit
25273c18c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 20
      ErsatzTV.Core/Scheduling/PlayoutBuilder.cs

1
CHANGELOG.md

@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix bug with XMLTV that caused some filler to display with primary content details
- Multiple fixes for content scaling with `Nvidia`, `Qsv` and `Vaapi` accelerations
- Properly scale image-based subtitles
- Abort when an infinite playout building loop is detected; proper bug fix will be released soon
### Added
- Add `Preferred Audio Title` feature

20
ErsatzTV.Core/Scheduling/PlayoutBuilder.cs

@ -423,9 +423,29 @@ public class PlayoutBuilder : IPlayoutBuilder @@ -423,9 +423,29 @@ public class PlayoutBuilder : IPlayoutBuilder
var schedulerDuration = new PlayoutModeSchedulerDuration(_logger);
var schedulerFlood = new PlayoutModeSchedulerFlood(_logger);
var timeHash = new Dictionary<DateTimeOffset, int>();
// loop until we're done filling the desired amount of time
while (playoutBuilderState.CurrentTime < playoutFinish)
{
if (timeHash.TryGetValue(playoutBuilderState.CurrentTime, out int count))
{
timeHash[playoutBuilderState.CurrentTime] = count + 1;
}
else
{
timeHash[playoutBuilderState.CurrentTime] = 1;
}
if (timeHash[playoutBuilderState.CurrentTime] == 6)
{
_logger.LogWarning(
"Failed to schedule beyond {Time}; aborting playout build - this is a bug",
playoutBuilderState.CurrentTime);
throw new ApplicationException("Scheduling loop encountered");
}
// _logger.LogDebug("Playout time is {CurrentTime}", playoutBuilderState.CurrentTime);
// get the schedule item out of the sorted list

Loading…
Cancel
Save