From f1d965c655781bc26b4ee84ef8c9b56fd7061e2f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 24 Aug 2016 22:54:21 -0400 Subject: [PATCH] update cards --- MediaBrowser.Dlna/PlayTo/Device.cs | 10 +++++----- MediaBrowser.Dlna/PlayTo/PlayToController.cs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Dlna/PlayTo/Device.cs b/MediaBrowser.Dlna/PlayTo/Device.cs index 6ad5899da1..174ca871a4 100644 --- a/MediaBrowser.Dlna/PlayTo/Device.cs +++ b/MediaBrowser.Dlna/PlayTo/Device.cs @@ -479,17 +479,17 @@ namespace MediaBrowser.Dlna.PlayTo _successiveStopCount++; _connectFailureCount++; - if (_successiveStopCount >= maxSuccessiveStopReturns) - { - RestartTimerInactive(); - } - if (_connectFailureCount >= maxSuccessiveStopReturns) + if (_connectFailureCount >= 3) { if (OnDeviceUnavailable != null) { OnDeviceUnavailable(); } } + if (_successiveStopCount >= maxSuccessiveStopReturns) + { + RestartTimerInactive(); + } } catch (Exception ex) { diff --git a/MediaBrowser.Dlna/PlayTo/PlayToController.cs b/MediaBrowser.Dlna/PlayTo/PlayToController.cs index 7429330bd6..913b34016d 100644 --- a/MediaBrowser.Dlna/PlayTo/PlayToController.cs +++ b/MediaBrowser.Dlna/PlayTo/PlayToController.cs @@ -99,11 +99,11 @@ namespace MediaBrowser.Dlna.PlayTo public void Init(Device device) { _device = device; + _device.OnDeviceUnavailable = OnDeviceUnavailable; _device.PlaybackStart += _device_PlaybackStart; _device.PlaybackProgress += _device_PlaybackProgress; _device.PlaybackStopped += _device_PlaybackStopped; _device.MediaChanged += _device_MediaChanged; - _device.OnDeviceUnavailable = OnDeviceUnavailable; _device.Start();