mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-05 15:28:28 +01:00
update live stream generation
This commit is contained in:
@@ -356,7 +356,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
_logger.Info("Opening channel stream from {0}, external channel Id: {1}", service.Name, channel.ExternalId);
|
||||
info = await service.GetChannelStream(channel.ExternalId, null, cancellationToken).ConfigureAwait(false);
|
||||
info.RequiresClosing = true;
|
||||
info.LiveStreamId = info.Id;
|
||||
|
||||
if (info.RequiresClosing)
|
||||
{
|
||||
info.LiveStreamId = info.Id;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -367,7 +371,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
_logger.Info("Opening recording stream from {0}, external recording Id: {1}", service.Name, recording.RecordingInfo.Id);
|
||||
info = await service.GetRecordingStream(recording.RecordingInfo.Id, null, cancellationToken).ConfigureAwait(false);
|
||||
info.RequiresClosing = true;
|
||||
info.LiveStreamId = info.Id;
|
||||
|
||||
if (info.RequiresClosing)
|
||||
{
|
||||
info.LiveStreamId = info.Id;
|
||||
}
|
||||
}
|
||||
|
||||
_logger.Info("Live stream info: {0}", _jsonSerializer.SerializeToString(info));
|
||||
|
||||
@@ -679,6 +679,18 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(info.LiveStreamId))
|
||||
{
|
||||
try
|
||||
{
|
||||
await _mediaSourceManager.PingLiveStream(info.LiveStreamId, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error closing live stream", ex);
|
||||
}
|
||||
}
|
||||
|
||||
EventHelper.FireEventIfNotNull(PlaybackProgress, this, new PlaybackProgressEventArgs
|
||||
{
|
||||
Item = libraryItem,
|
||||
@@ -769,6 +781,18 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(info.LiveStreamId))
|
||||
{
|
||||
try
|
||||
{
|
||||
await _mediaSourceManager.CloseLiveStream(info.LiveStreamId, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error closing live stream", ex);
|
||||
}
|
||||
}
|
||||
|
||||
EventHelper.QueueEventIfNotNull(PlaybackStopped, this, new PlaybackStopEventArgs
|
||||
{
|
||||
Item = libraryItem,
|
||||
|
||||
Reference in New Issue
Block a user