diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-03-07 13:27:56 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-03-07 13:27:56 -0500 |
| commit | 9fa6868af3decfa85fe51243b863e5d790fa1246 (patch) | |
| tree | 95a5288a090cfe00d8362c27d5f7e266609f1640 /Emby.Server.Implementations/LiveTv | |
| parent | 9e74d834a7bbd236daab15ab6d98a0e6a301c150 (diff) | |
update legacy hd homerun support
Diffstat (limited to 'Emby.Server.Implementations/LiveTv')
| -rw-r--r-- | Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs | 1 | ||||
| -rw-r--r-- | Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs | 25 |
2 files changed, 25 insertions, 1 deletions
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index 25d7de0fd..62385e172 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -596,6 +596,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun else { var mediaSource = GetMediaSource(info, hdhrId, channelInfo, profile); + //var modelInfo = await GetModelInfo(info, false, cancellationToken).ConfigureAwait(false); return new HdHomerunHttpStream(mediaSource, streamId, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost); //return new HdHomerunUdpStream(mediaSource, streamId, new HdHomerunChannelCommands(hdhomerunChannel.Number), modelInfo.TunerCount, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost, _socketFactory, _networkManager); diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs index 0c3ba3041..2c678d9f8 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs @@ -145,7 +145,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun { var channelMsg = CreateSetMessage(i, command.Item1, command.Item2, _lockkey.Value); await tcpClient.SendAsync(channelMsg, channelMsg.Length, ipEndPoint, cancellationToken).ConfigureAwait(false); - await tcpClient.ReceiveAsync(cancellationToken).ConfigureAwait(false); + response = await tcpClient.ReceiveAsync(cancellationToken).ConfigureAwait(false); // parse response to make sure it worked if (!ParseReturnMessage(response.Buffer, response.ReceivedBytes, out returnVal)) { @@ -172,6 +172,29 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun } } + public async Task ChangeChannel(IHdHomerunChannelCommands commands, CancellationToken cancellationToken) + { + if (!_lockkey.HasValue) + return; + + using (var tcpClient = _socketFactory.CreateTcpSocket(_remoteIp, HdHomeRunPort)) + { + var commandList = commands.GetCommands(); + foreach (Tuple<string, string> command in commandList) + { + var channelMsg = CreateSetMessage(_activeTuner, command.Item1, command.Item2, _lockkey.Value); + await tcpClient.SendAsync(channelMsg, channelMsg.Length, new IpEndPointInfo(_remoteIp, HdHomeRunPort), cancellationToken).ConfigureAwait(false); + var response = await tcpClient.ReceiveAsync(cancellationToken).ConfigureAwait(false); + // parse response to make sure it worked + string returnVal; + if (!ParseReturnMessage(response.Buffer, response.ReceivedBytes, out returnVal)) + { + return; + } + } + } + } + public async Task StopStreaming() { if (!_lockkey.HasValue) |
