From 0a7513622348a93721612703ecd901842dd35295 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Mon, 28 Aug 2023 22:01:38 -0500 Subject: [PATCH] fix transcoding short content (#1399) --- .../Queries/GetPlayoutItemProcessByChannelNumberHandler.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs b/ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs index 86214a121..a80c3468d 100644 --- a/ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs +++ b/ErsatzTV.Application/Streaming/Queries/GetPlayoutItemProcessByChannelNumberHandler.cs @@ -177,7 +177,9 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler< TimeSpan inPoint = playoutItemWithPath.PlayoutItem.InPoint; TimeSpan outPoint = playoutItemWithPath.PlayoutItem.OutPoint; DateTimeOffset effectiveNow = request.StartAtZero ? start : now; - if (!request.HlsRealtime && (outPoint - inPoint) > TimeSpan.FromMinutes(2)) + TimeSpan duration = finish - effectiveNow; + + if (!request.HlsRealtime && duration > TimeSpan.FromMinutes(2)) { finish = effectiveNow + TimeSpan.FromMinutes(2); outPoint = finish - start + TimeSpan.FromMinutes(2); @@ -214,7 +216,7 @@ public class GetPlayoutItemProcessByChannelNumberHandler : FFmpegProcessHandler< playoutItemWithPath.PlayoutItem.DisableWatermarks, _ => { }); - var result = new PlayoutItemProcessModel(process, finish - effectiveNow, finish); + var result = new PlayoutItemProcessModel(process, duration, finish); return Right(result); }