mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
update GetChannelStream
This commit is contained in:
parent
ea66ed6a71
commit
8be997b8ad
1 changed files with 20 additions and 7 deletions
|
@ -88,7 +88,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||||
|
|
||||||
private class HdHomerunChannelInfo : ChannelInfo
|
private class HdHomerunChannelInfo : ChannelInfo
|
||||||
{
|
{
|
||||||
public string Url { get; set; }
|
public bool IsLegacyTuner { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task<List<ChannelInfo>> GetChannelsInternal(TunerHostInfo info, CancellationToken cancellationToken)
|
protected override async Task<List<ChannelInfo>> GetChannelsInternal(TunerHostInfo info, CancellationToken cancellationToken)
|
||||||
|
@ -106,7 +106,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||||
AudioCodec = i.AudioCodec,
|
AudioCodec = i.AudioCodec,
|
||||||
VideoCodec = i.VideoCodec,
|
VideoCodec = i.VideoCodec,
|
||||||
ChannelType = ChannelType.TV,
|
ChannelType = ChannelType.TV,
|
||||||
Url = info.Url
|
IsLegacyTuner = (info.Url ?? string.Empty).StartsWith("hdhomerun", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|
||||||
}).Cast<ChannelInfo>().ToList();
|
}).Cast<ChannelInfo>().ToList();
|
||||||
}
|
}
|
||||||
|
@ -504,7 +504,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||||
|
|
||||||
var hdHomerunChannelInfo = channelInfo as HdHomerunChannelInfo;
|
var hdHomerunChannelInfo = channelInfo as HdHomerunChannelInfo;
|
||||||
|
|
||||||
var isLegacyTuner = hdHomerunChannelInfo != null && hdHomerunChannelInfo.Url.StartsWith("hdhomerun:", StringComparison.OrdinalIgnoreCase);
|
var isLegacyTuner = hdHomerunChannelInfo != null && hdHomerunChannelInfo.IsLegacyTuner;
|
||||||
|
|
||||||
if (isLegacyTuner)
|
if (isLegacyTuner)
|
||||||
{
|
{
|
||||||
|
@ -572,12 +572,25 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||||
var channels = await GetChannels(info, true, CancellationToken.None).ConfigureAwait(false);
|
var channels = await GetChannels(info, true, CancellationToken.None).ConfigureAwait(false);
|
||||||
var channelInfo = channels.FirstOrDefault(i => string.Equals(i.Number, channelId, StringComparison.OrdinalIgnoreCase));
|
var channelInfo = channels.FirstOrDefault(i => string.Equals(i.Number, channelId, StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
var hdhomerunChannel = channelInfo as HdHomerunChannelInfo;
|
||||||
|
|
||||||
|
if (hdhomerunChannel != null && hdhomerunChannel.IsLegacyTuner)
|
||||||
|
{
|
||||||
|
var mediaSource = GetLegacyMediaSource(info, hdhrId, channelInfo);
|
||||||
|
|
||||||
|
var liveStream = new HdHomerunLiveStream(mediaSource, streamId, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost);
|
||||||
|
liveStream.EnableStreamSharing = true;
|
||||||
|
return liveStream;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
var mediaSource = GetMediaSource(info, hdhrId, channelInfo, profile);
|
var mediaSource = GetMediaSource(info, hdhrId, channelInfo, profile);
|
||||||
|
|
||||||
var liveStream = new HdHomerunLiveStream(mediaSource, streamId, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost);
|
var liveStream = new HdHomerunLiveStream(mediaSource, streamId, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost);
|
||||||
liveStream.EnableStreamSharing = true;
|
liveStream.EnableStreamSharing = true;
|
||||||
return liveStream;
|
return liveStream;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async Task Validate(TunerHostInfo info)
|
public async Task Validate(TunerHostInfo info)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue