Merge pull request #12964 from nyanmisaka/fix-imported-trickplay-height

Fix height of imported trickplay tiles
This commit is contained in:
Joshua M. Boniface 2024-11-09 10:13:58 -05:00 committed by GitHub
commit 09c377fb6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -238,7 +238,7 @@ public class TrickplayManager : ITrickplayManager
foreach (var tile in existingFiles)
{
var image = _imageEncoder.GetImageSize(tile);
localTrickplayInfo.Height = Math.Max(localTrickplayInfo.Height, image.Height);
localTrickplayInfo.Height = Math.Max(localTrickplayInfo.Height, (int)Math.Ceiling((double)image.Height / localTrickplayInfo.TileHeight));
var bitrate = (int)Math.Ceiling((decimal)new FileInfo(tile).Length * 8 / localTrickplayInfo.TileWidth / localTrickplayInfo.TileHeight / (localTrickplayInfo.Interval / 1000));
localTrickplayInfo.Bandwidth = Math.Max(localTrickplayInfo.Bandwidth, bitrate);
}