From 0540f1b4922ebc10783c293e977f662cb206d464 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 22 Dec 2015 12:27:04 -0500 Subject: [PATCH] update bdinfo --- MediaBrowser.Controller/Entities/Video.cs | 2 - .../MediaInfo/FFProbeVideoInfo.cs | 72 ++++++++++--------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index 2a59dd7f7c..1972226692 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -298,8 +298,6 @@ namespace MediaBrowser.Controller.Entities return base.IsValidFromResolver(newItem); } - public string MainFeaturePlaylistName { get; set; } - /// /// Gets the playable stream files. /// diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs index 4744b37290..efa6ff0cf4 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfo.cs @@ -297,52 +297,54 @@ namespace MediaBrowser.Providers.MediaInfo { var video = (Video)item; - int? currentHeight = null; - int? currentWidth = null; - int? currentBitRate = null; - - var videoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); + video.PlayableStreamFileNames = blurayInfo.Files.ToList(); - // Grab the values that ffprobe recorded - if (videoStream != null) + // Use BD Info if it has multiple m2ts. Otherwise, treat it like a video file and rely more on ffprobe output + if (blurayInfo.Files.Count > 1) { - currentBitRate = videoStream.BitRate; - currentWidth = videoStream.Width; - currentHeight = videoStream.Height; - } + int? currentHeight = null; + int? currentWidth = null; + int? currentBitRate = null; - // Fill video properties from the BDInfo result - mediaStreams.Clear(); - mediaStreams.AddRange(blurayInfo.MediaStreams); + var videoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); - video.MainFeaturePlaylistName = blurayInfo.PlaylistName; - - if (blurayInfo.RunTimeTicks.HasValue && blurayInfo.RunTimeTicks.Value > 0) - { - video.RunTimeTicks = blurayInfo.RunTimeTicks; - } + // Grab the values that ffprobe recorded + if (videoStream != null) + { + currentBitRate = videoStream.BitRate; + currentWidth = videoStream.Width; + currentHeight = videoStream.Height; + } - video.PlayableStreamFileNames = blurayInfo.Files.ToList(); + // Fill video properties from the BDInfo result + mediaStreams.Clear(); + mediaStreams.AddRange(blurayInfo.MediaStreams); - if (blurayInfo.Chapters != null) - { - chapters.Clear(); + if (blurayInfo.RunTimeTicks.HasValue && blurayInfo.RunTimeTicks.Value > 0) + { + video.RunTimeTicks = blurayInfo.RunTimeTicks; + } - chapters.AddRange(blurayInfo.Chapters.Select(c => new ChapterInfo + if (blurayInfo.Chapters != null) { - StartPositionTicks = TimeSpan.FromSeconds(c).Ticks + chapters.Clear(); - })); - } + chapters.AddRange(blurayInfo.Chapters.Select(c => new ChapterInfo + { + StartPositionTicks = TimeSpan.FromSeconds(c).Ticks - videoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); + })); + } - // Use the ffprobe values if these are empty - if (videoStream != null) - { - videoStream.BitRate = IsEmpty(videoStream.BitRate) ? currentBitRate : videoStream.BitRate; - videoStream.Width = IsEmpty(videoStream.Width) ? currentWidth : videoStream.Width; - videoStream.Height = IsEmpty(videoStream.Height) ? currentHeight : videoStream.Height; + videoStream = mediaStreams.FirstOrDefault(s => s.Type == MediaStreamType.Video); + + // Use the ffprobe values if these are empty + if (videoStream != null) + { + videoStream.BitRate = IsEmpty(videoStream.BitRate) ? currentBitRate : videoStream.BitRate; + videoStream.Width = IsEmpty(videoStream.Width) ? currentWidth : videoStream.Width; + videoStream.Height = IsEmpty(videoStream.Height) ? currentHeight : videoStream.Height; + } } }