mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 05:57:20 -04:00
Make ILiveStream an IDisposable
This commit is contained in:
parent
669baf98a5
commit
192559db32
3 changed files with 23 additions and 2 deletions
|
@ -12,7 +12,7 @@ using MediaBrowser.Model.Dto;
|
|||
|
||||
namespace Emby.Server.Implementations.Library
|
||||
{
|
||||
public class ExclusiveLiveStream : ILiveStream
|
||||
public sealed class ExclusiveLiveStream : ILiveStream
|
||||
{
|
||||
private readonly Func<Task> _closeFn;
|
||||
|
||||
|
@ -51,5 +51,10 @@ namespace Emby.Server.Implementations.Library
|
|||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,6 +112,21 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
|||
return stream;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose(bool dispose)
|
||||
{
|
||||
if (dispose)
|
||||
{
|
||||
LiveStreamCancellationTokenSource?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task DeleteTempFiles(string path, int retryCount = 0)
|
||||
{
|
||||
if (retryCount == 0)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#pragma warning disable CA1711, CS1591
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -9,7 +10,7 @@ using MediaBrowser.Model.Dto;
|
|||
|
||||
namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
public interface ILiveStream
|
||||
public interface ILiveStream : IDisposable
|
||||
{
|
||||
int ConsumerCount { get; set; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue