From 337777afc981e200f60f8c994984c9138a6a2ffb Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 17 May 2015 09:55:48 -0400 Subject: [PATCH] update dlna resume --- MediaBrowser.Dlna/PlayTo/PlayToController.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MediaBrowser.Dlna/PlayTo/PlayToController.cs b/MediaBrowser.Dlna/PlayTo/PlayToController.cs index 2c3fbfeff..b652d2fe9 100644 --- a/MediaBrowser.Dlna/PlayTo/PlayToController.cs +++ b/MediaBrowser.Dlna/PlayTo/PlayToController.cs @@ -385,6 +385,16 @@ namespace MediaBrowser.Dlna.PlayTo if (newItem.StreamInfo.IsDirectStream) { + await Task.Delay(1000).ConfigureAwait(false); + + var maxWait = 15000000; + var currentWait = 0; + while (_device.TransportState != TRANSPORTSTATE.PLAYING && currentWait < maxWait) + { + await Task.Delay(1000).ConfigureAwait(false); + currentWait += 1000; + } + await _device.Seek(TimeSpan.FromTicks(newPosition)).ConfigureAwait(false); } return;