mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 19:37:55 +02:00
Fixed bug where the server would eat up ram with subtitles request
This commit is contained in:
parent
27f0633ed8
commit
d02642bf7b
1 changed files with 8 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.MediaEncoding;
|
using MediaBrowser.Controller.MediaEncoding;
|
||||||
using MediaBrowser.Controller.Net;
|
using MediaBrowser.Controller.Net;
|
||||||
|
@ -156,6 +156,12 @@ namespace MediaBrowser.Api.Subtitles
|
||||||
throw new ArgumentException("HLS Subtitles are not supported for this media.");
|
throw new ArgumentException("HLS Subtitles are not supported for this media.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var segmentLengthTicks = TimeSpan.FromSeconds(request.SegmentLength).Ticks;
|
||||||
|
if (segmentLengthTicks <= 0)
|
||||||
|
{
|
||||||
|
throw new ArgumentException("segmentLength was not given, or it was given incorrectly. (It should be bigger than 0)");
|
||||||
|
}
|
||||||
|
|
||||||
builder.AppendLine("#EXTM3U");
|
builder.AppendLine("#EXTM3U");
|
||||||
builder.AppendLine("#EXT-X-TARGETDURATION:" + request.SegmentLength.ToString(CultureInfo.InvariantCulture));
|
builder.AppendLine("#EXT-X-TARGETDURATION:" + request.SegmentLength.ToString(CultureInfo.InvariantCulture));
|
||||||
builder.AppendLine("#EXT-X-VERSION:3");
|
builder.AppendLine("#EXT-X-VERSION:3");
|
||||||
|
@ -163,7 +169,6 @@ namespace MediaBrowser.Api.Subtitles
|
||||||
builder.AppendLine("#EXT-X-PLAYLIST-TYPE:VOD");
|
builder.AppendLine("#EXT-X-PLAYLIST-TYPE:VOD");
|
||||||
|
|
||||||
long positionTicks = 0;
|
long positionTicks = 0;
|
||||||
var segmentLengthTicks = TimeSpan.FromSeconds(request.SegmentLength).Ticks;
|
|
||||||
|
|
||||||
var accessToken = _authContext.GetAuthorizationInfo(Request).Token;
|
var accessToken = _authContext.GetAuthorizationInfo(Request).Token;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue