|
|
|
@ -103,20 +103,7 @@ public class PlayoutItemConverter( |
|
|
|
|
|
|
|
|
|
|
|
foreach (Core.Next.Source source in maybeSource) |
|
|
|
foreach (Core.Next.Source source in maybeSource) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (playoutItem is not DynamicPlayoutItem) |
|
|
|
SetInOutPoints(playoutItem, source); |
|
|
|
{ |
|
|
|
|
|
|
|
if (playoutItem.InPoint > TimeSpan.Zero) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
source.InPointMs = (long)playoutItem.InPoint.TotalMilliseconds; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var duration = playoutItem.MediaItem.GetDurationForPlayout(); |
|
|
|
|
|
|
|
if (playoutItem.OutPoint > TimeSpan.Zero && playoutItem.OutPoint < duration) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
source.OutPointMs = (long)playoutItem.OutPoint.TotalMilliseconds; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nextPlayoutItem.Source = source; |
|
|
|
nextPlayoutItem.Source = source; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -158,7 +145,7 @@ public class PlayoutItemConverter( |
|
|
|
Codec = s.Codec |
|
|
|
Codec = s.Codec |
|
|
|
}).ToList(); |
|
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
nextPlayoutItem.Source.ProbeHint = new Core.Next.ProbeHint |
|
|
|
nextPlayoutItem.Source!.ProbeHint = new Core.Next.ProbeHint |
|
|
|
{ |
|
|
|
{ |
|
|
|
Audio = sourceAudioHints, |
|
|
|
Audio = sourceAudioHints, |
|
|
|
Video = sourceVideoHints, |
|
|
|
Video = sourceVideoHints, |
|
|
|
@ -427,6 +414,8 @@ public class PlayoutItemConverter( |
|
|
|
foreach (Subtitle subtitle in maybeSubtitle) |
|
|
|
foreach (Subtitle subtitle in maybeSubtitle) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (subtitle.SubtitleKind is SubtitleKind.Embedded) |
|
|
|
if (subtitle.SubtitleKind is SubtitleKind.Embedded) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (subtitle.IsImage) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (nextPlayoutItem.Tracks?.Subtitle?.StreamIndex is null) |
|
|
|
if (nextPlayoutItem.Tracks?.Subtitle?.StreamIndex is null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -435,6 +424,23 @@ public class PlayoutItemConverter( |
|
|
|
nextPlayoutItem.Tracks.Subtitle.StreamIndex = subtitle.StreamIndex; |
|
|
|
nextPlayoutItem.Tracks.Subtitle.StreamIndex = subtitle.StreamIndex; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// next only supports sidecar text subtitles at the moment; ignore non-extracted text subs
|
|
|
|
|
|
|
|
else if (subtitle.IsExtracted && !string.IsNullOrWhiteSpace(subtitle.Path)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (nextPlayoutItem.Tracks?.Subtitle?.Source is null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
nextPlayoutItem.Tracks ??= new Core.Next.PlayoutItemTracks(); |
|
|
|
|
|
|
|
nextPlayoutItem.Tracks.Subtitle ??= new Core.Next.TrackSelection(); |
|
|
|
|
|
|
|
nextPlayoutItem.Tracks.Subtitle.Source = new Core.Next.Source |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
SourceType = Core.Next.SourceType.Local, |
|
|
|
|
|
|
|
Path = Path.Combine(FileSystemLayout.SubtitleCacheFolder, subtitle.Path), |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetInOutPoints(playoutItem, nextPlayoutItem.Tracks.Subtitle.Source); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else if (!subtitle.Path.StartsWith("http", StringComparison.OrdinalIgnoreCase)) |
|
|
|
else if (!subtitle.Path.StartsWith("http", StringComparison.OrdinalIgnoreCase)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (nextPlayoutItem.Tracks?.Subtitle?.Source is null) |
|
|
|
if (nextPlayoutItem.Tracks?.Subtitle?.Source is null) |
|
|
|
@ -446,6 +452,8 @@ public class PlayoutItemConverter( |
|
|
|
SourceType = Core.Next.SourceType.Local, |
|
|
|
SourceType = Core.Next.SourceType.Local, |
|
|
|
Path = subtitle.Path, |
|
|
|
Path = subtitle.Path, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetInOutPoints(playoutItem, nextPlayoutItem.Tracks.Subtitle.Source); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (subtitle.Path.StartsWith("http://localhost", StringComparison.OrdinalIgnoreCase)) |
|
|
|
else if (subtitle.Path.StartsWith("http://localhost", StringComparison.OrdinalIgnoreCase)) |
|
|
|
@ -461,6 +469,8 @@ public class PlayoutItemConverter( |
|
|
|
KeepAlive = false, |
|
|
|
KeepAlive = false, |
|
|
|
Reconnect = true |
|
|
|
Reconnect = true |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetInOutPoints(playoutItem, nextPlayoutItem.Tracks.Subtitle.Source); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -602,4 +612,21 @@ public class PlayoutItemConverter( |
|
|
|
} |
|
|
|
} |
|
|
|
]; |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void SetInOutPoints(PlayoutItem playoutItem, Core.Next.Source source) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (playoutItem is not DynamicPlayoutItem) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (playoutItem.InPoint > TimeSpan.Zero) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
source.InPointMs = (long)playoutItem.InPoint.TotalMilliseconds; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var duration = playoutItem.MediaItem.GetDurationForPlayout(); |
|
|
|
|
|
|
|
if (playoutItem.OutPoint > TimeSpan.Zero && playoutItem.OutPoint < duration) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
source.OutPointMs = (long)playoutItem.OutPoint.TotalMilliseconds; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|