From 527cdf523cc95d005adddcb897367aea1853ae7e Mon Sep 17 00:00:00 2001 From: Jason Dove Date: Wed, 16 Nov 2022 21:17:23 -0600 Subject: [PATCH] fix work-ahead limit setting (#1023) --- CHANGELOG.md | 1 + ErsatzTV.Application/Streaming/HlsSessionWorker.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f5d0edf2..ce1f5e473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### Fixed - Fix removing Jellyfin and Emby libraries that have been deleted from the source media server +- Fix `Work-Ahead HLS Segmenter Limit` setting to properly limit number of channels that can work-ahead at once ### Added - Add audio stream selector scripts for episodes and movies diff --git a/ErsatzTV.Application/Streaming/HlsSessionWorker.cs b/ErsatzTV.Application/Streaming/HlsSessionWorker.cs index 9c456133e..220310c3a 100644 --- a/ErsatzTV.Application/Streaming/HlsSessionWorker.cs +++ b/ErsatzTV.Application/Streaming/HlsSessionWorker.cs @@ -351,7 +351,10 @@ public class HlsSessionWorker : IHlsSessionWorker } finally { - Interlocked.Decrement(ref _workAheadCount); + if (!realtime) + { + Interlocked.Decrement(ref _workAheadCount); + } } return false;