aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Trickplay
diff options
context:
space:
mode:
authorgnattu <gnattu@users.noreply.github.com>2024-05-25 11:46:18 -0400
committerJoshua M. Boniface <joshua@boniface.me>2024-05-25 11:46:18 -0400
commite6dab2fa1124c59de167484cd9d0d979d22b209f (patch)
treedc1f9754c009480961d7e2dbe724f3431beb9f77 /Jellyfin.Server.Implementations/Trickplay
parent5c828df5670aafa9e79786a8310ff103cc57e05d (diff)
Backport pull request #11788 from jellyfin/release-10.9.z
Override too small trickplay image interval Original-merge: 60232ce9be8d26926ed81294b93a77da02b5a2fe Merged-by: Bond-009 <bond.009@outlook.com> Backported-by: Joshua M. Boniface <joshua@boniface.me>
Diffstat (limited to 'Jellyfin.Server.Implementations/Trickplay')
-rw-r--r--Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs b/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs
index ad840e66d..efdfc745f 100644
--- a/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs
+++ b/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs
@@ -81,6 +81,12 @@ public class TrickplayManager : ITrickplayManager
_logger.LogDebug("Trickplay refresh for {ItemId} (replace existing: {Replace})", video.Id, replace);
var options = _config.Configuration.TrickplayOptions;
+ if (options.Interval < 1000)
+ {
+ _logger.LogWarning("Trickplay image interval {Interval} is too small, reset to the minimum valid value of 1000", options.Interval);
+ options.Interval = 1000;
+ }
+
foreach (var width in options.WidthResolutions)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -267,7 +273,7 @@ public class TrickplayManager : ITrickplayManager
}
// Update bitrate
- var bitrate = (int)Math.Ceiling((decimal)new FileInfo(tilePath).Length * 8 / trickplayInfo.TileWidth / trickplayInfo.TileHeight / (trickplayInfo.Interval / 1000));
+ var bitrate = (int)Math.Ceiling(new FileInfo(tilePath).Length * 8m / trickplayInfo.TileWidth / trickplayInfo.TileHeight / (trickplayInfo.Interval / 1000m));
trickplayInfo.Bandwidth = Math.Max(trickplayInfo.Bandwidth, bitrate);
}