diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs index b6b1c0c03..165f123f1 100644 --- a/Emby.Dlna/PlayTo/Device.cs +++ b/Emby.Dlna/PlayTo/Device.cs @@ -662,7 +662,33 @@ namespace Emby.Dlna.PlayTo var e = track.Element(uPnpNamespaces.items) ?? track; - return UpnpContainer.Create(e); + var elementString = (string)e; + + if (!string.IsNullOrWhiteSpace(elementString)) + { + return UpnpContainer.Create(e); + } + + track = result.Document.Descendants("CurrentURI").FirstOrDefault(); + + if (track == null) + { + return null; + } + + e = track.Element(uPnpNamespaces.items) ?? track; + + elementString = (string)e; + + if (!string.IsNullOrWhiteSpace(elementString)) + { + return new uBaseObject + { + Url = elementString + }; + } + + return null; } private async Task> GetPositionInfo() @@ -720,7 +746,7 @@ namespace Emby.Dlna.PlayTo if (string.IsNullOrWhiteSpace(trackString) || string.Equals(trackString, "NOT_IMPLEMENTED", StringComparison.OrdinalIgnoreCase)) { - return new Tuple(false, null); + return new Tuple(true, null); } XElement uPnpResponse; diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs index 4b4f61d53..787dcb5d3 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/BaseTunerHost.cs @@ -247,7 +247,10 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts try { var liveStream = await GetChannelStream(host, channelId, streamId, cancellationToken).ConfigureAwait(false); + var startTime = DateTime.UtcNow; await liveStream.Open(cancellationToken).ConfigureAwait(false); + var endTime = DateTime.UtcNow; + Logger.Info("Live stream opened after {0}ms", (endTime - startTime).TotalMilliseconds); return liveStream; } catch (Exception ex) diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs index f974b5c2c..b9a58a011 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs @@ -347,6 +347,15 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun videoCodec = "h264"; videoBitrate = 1000000; } + else + { + // This is for android tv's 1200 condition. Remove once not needed anymore so that we can avoid possible side effects of dummying up this data + if ((channelInfo.IsHD ?? true)) + { + width = 1920; + height = 1080; + } + } if (channelInfo != null) { diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs index c530d48c2..bf3febaf2 100644 --- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs +++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunUdpStream.cs @@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun _tempFilePath = Path.Combine(appPaths.TranscodingTempPath, UniqueId + ".ts"); } - protected override async Task OpenInternal(CancellationToken openCancellationToken) + protected override Task OpenInternal(CancellationToken openCancellationToken) { _liveStreamCancellationTokenSource.Token.ThrowIfCancellationRequested(); @@ -73,7 +73,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun //OpenedMediaSource.SupportsDirectStream = true; //OpenedMediaSource.SupportsTranscoding = true; - await taskCompletionSource.Task.ConfigureAwait(false); + return taskCompletionSource.Task; //await Task.Delay(5000).ConfigureAwait(false); } diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 368c0cf32..ee7b9f080 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -799,13 +799,12 @@ namespace MediaBrowser.Controller.MediaEncoding if (videoStream.IsInterlaced) { - if (state.DeInterlace(videoStream.Codec)) + if (state.DeInterlace(videoStream.Codec, false)) { return false; } } - if (videoStream.IsAnamorphic ?? false) { if (request.RequireNonAnamorphic) @@ -1365,7 +1364,7 @@ namespace MediaBrowser.Controller.MediaEncoding filters.Add("hwupload"); } - if (state.DeInterlace("h264") && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase)) + if (state.DeInterlace("h264", true) && !string.Equals(outputVideoCodec, "h264_vaapi", StringComparison.OrdinalIgnoreCase)) { // If it is already 60fps then it will create an output framerate that is much too high for roku and others to handle if (string.Equals(options.DeinterlaceMethod, "bobandweave", StringComparison.OrdinalIgnoreCase) && (state.VideoStream.RealFrameRate ?? 60) <= 30) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs index 450bbf7c1..cf067ddf4 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs @@ -161,7 +161,7 @@ namespace MediaBrowser.Controller.MediaEncoding public int? OutputAudioBitrate; public int? OutputAudioChannels; - public bool DeInterlace(string videoCodec) + public bool DeInterlace(string videoCodec, bool forceDeinterlaceIfSourceIsInterlaced) { // Support general param if (BaseRequest.DeInterlace) @@ -177,6 +177,15 @@ namespace MediaBrowser.Controller.MediaEncoding } } + if (forceDeinterlaceIfSourceIsInterlaced) + { + var videoStream = VideoStream; + if (videoStream != null && videoStream.IsInterlaced) + { + return true; + } + } + return false; } @@ -559,7 +568,7 @@ namespace MediaBrowser.Controller.MediaEncoding return VideoStream == null ? (bool?)null : VideoStream.IsInterlaced; } - if (DeInterlace(ActualOutputVideoCodec)) + if (DeInterlace(ActualOutputVideoCodec, true)) { return false; } diff --git a/SharedVersion.cs b/SharedVersion.cs index f48c78f88..9576d512d 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.32.8")] +[assembly: AssemblyVersion("3.2.32.9")]