mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-22 00:35:26 +03:00
update path fields
This commit is contained in:
@@ -960,5 +960,30 @@ namespace MediaBrowser.Api.Playback.Hls
|
||||
{
|
||||
return isOutputVideo ? ".ts" : ".ts";
|
||||
}
|
||||
|
||||
protected override bool CanStreamCopyVideo(VideoStreamRequest request, MediaStream videoStream)
|
||||
{
|
||||
if (videoStream.KeyFrames == null || videoStream.KeyFrames.Count == 0)
|
||||
{
|
||||
Logger.Debug("Cannot stream copy video due to missing keyframe info");
|
||||
return false;
|
||||
}
|
||||
|
||||
var previousSegment = 0;
|
||||
foreach (var frame in videoStream.KeyFrames)
|
||||
{
|
||||
var length = frame - previousSegment;
|
||||
|
||||
// Don't allow really long segments because this could result in long download times
|
||||
if (length > 10000)
|
||||
{
|
||||
Logger.Debug("Cannot stream copy video due to long segment length of {0}ms", length);
|
||||
return false;
|
||||
}
|
||||
previousSegment = frame;
|
||||
}
|
||||
|
||||
return base.CanStreamCopyVideo(request, videoStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user