fix scheduling precision error (#1451)
* fix scheduling precision error * update dependencies
This commit is contained in:
@@ -13,6 +13,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- The goal is to fill the canvas by over-scaling and cropping, instead of minimally scaling and padding
|
||||
- Include `inputstream.ffmpegdirect` properties in channels.m3u when requested by Kodi
|
||||
|
||||
### Fixed
|
||||
- Fix playout bug that caused some schedule items with fixed start times to be pushed to the next day
|
||||
|
||||
### Changed
|
||||
- Upgrade ffmpeg to 6.1, which is now *required* for all installs
|
||||
- Use new ffmpeg throttling method to minimize cpu/gpu use without impacting audio normalization
|
||||
|
||||
@@ -41,6 +41,7 @@ public abstract class PlayoutModeSchedulerBase<T> : IPlayoutModeScheduler<T> whe
|
||||
public static DateTimeOffset GetStartTimeAfter(PlayoutBuilderState state, ProgramScheduleItem scheduleItem)
|
||||
{
|
||||
DateTimeOffset startTime = state.CurrentTime.ToLocalTime();
|
||||
startTime = startTime.AddTicks(-(startTime.Ticks % TimeSpan.TicksPerSecond));
|
||||
|
||||
bool isIncomplete = scheduleItem is ProgramScheduleItemMultiple && state.MultipleRemaining.IsSome ||
|
||||
scheduleItem is ProgramScheduleItemDuration && state.DurationFinish.IsSome ||
|
||||
@@ -50,6 +51,8 @@ public abstract class PlayoutModeSchedulerBase<T> : IPlayoutModeScheduler<T> whe
|
||||
if (scheduleItem.StartType == StartType.Fixed && !isIncomplete)
|
||||
{
|
||||
TimeSpan itemStartTime = scheduleItem.StartTime.GetValueOrDefault();
|
||||
itemStartTime = TimeSpan.FromMilliseconds((int)itemStartTime.TotalMilliseconds);
|
||||
|
||||
DateTime date = startTime.Date;
|
||||
DateTimeOffset result = new DateTimeOffset(
|
||||
date.Year,
|
||||
@@ -62,7 +65,11 @@ public abstract class PlayoutModeSchedulerBase<T> : IPlayoutModeScheduler<T> whe
|
||||
new DateTime(date.Year, date.Month, date.Day, 0, 0, 0, DateTimeKind.Local)))
|
||||
.Add(itemStartTime);
|
||||
|
||||
// DateTimeOffset result = startTime.Date + itemStartTime;
|
||||
// Serilog.Log.Logger.Debug(
|
||||
// "StartTimeOfDay: {StartTimeOfDay} Item Start Time: {ItemStartTime}",
|
||||
// startTime.TimeOfDay.TotalMilliseconds,
|
||||
// itemStartTime.TotalMilliseconds);
|
||||
|
||||
// need to wrap to the next day if appropriate
|
||||
startTime = startTime.TimeOfDay > itemStartTime ? result.AddDays(1) : result;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<PackageReference Include="NSubstitute" Version="5.1.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.7.0">
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.8.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<PackageReference Include="NSubstitute" Version="5.1.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.7.0">
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.8.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<PackageReference Include="Bugsnag.AspNet.Core" Version="3.1.0" />
|
||||
<PackageReference Include="FluentValidation" Version="11.7.1" />
|
||||
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
|
||||
<PackageReference Include="HtmlSanitizer" Version="8.0.692" />
|
||||
<PackageReference Include="HtmlSanitizer" Version="8.0.718" />
|
||||
<PackageReference Include="LanguageExt.Core" Version="4.4.5" />
|
||||
<PackageReference Include="Markdig" Version="0.33.0" />
|
||||
<PackageReference Include="MediatR.Courier.DependencyInjection" Version="5.0.0" />
|
||||
|
||||
Reference in New Issue
Block a user