Detach TranscodingJob from StreamState

This commit is contained in:
nyanmisaka 2022-06-24 23:09:28 +08:00
parent 5dbe16d3e6
commit 506ed6940b
2 changed files with 2 additions and 10 deletions

View File

@ -654,8 +654,8 @@ namespace Jellyfin.Api.Helpers
{
if (EnableThrottling(state))
{
transcodingJob.TranscodingThrottler = state.TranscodingThrottler = new TranscodingThrottler(transcodingJob, new Logger<TranscodingThrottler>(new LoggerFactory()), _serverConfigurationManager, _fileSystem);
state.TranscodingThrottler.Start();
transcodingJob.TranscodingThrottler = new TranscodingThrottler(transcodingJob, new Logger<TranscodingThrottler>(new LoggerFactory()), _serverConfigurationManager, _fileSystem);
transcodingJob.TranscodingThrottler.Start();
}
}

View File

@ -47,11 +47,6 @@ namespace Jellyfin.Api.Models.StreamingDtos
}
}
/// <summary>
/// Gets or sets the transcoding throttler.
/// </summary>
public TranscodingThrottler? TranscodingThrottler { get; set; }
/// <summary>
/// Gets the video request.
/// </summary>
@ -191,11 +186,8 @@ namespace Jellyfin.Api.Models.StreamingDtos
{
_mediaSourceManager.CloseLiveStream(MediaSource.LiveStreamId).GetAwaiter().GetResult();
}
TranscodingThrottler?.Dispose();
}
TranscodingThrottler = null;
TranscodingJob = null;
_disposed = true;