diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index fea44c9a8..b97afc217 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -618,7 +618,7 @@ namespace MediaBrowser.Api.Playback // Don't re-encode ass/ssa to ass because ffmpeg ass encoder fails if there's more than one ass rectangle. Affect Anime mostly. // See https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2013-April/063616.html - bool isAssSubtitle = string.Equals(state.SubtitleStream.Codec, "ass", StringComparison.OrdinalIgnoreCase) || string.Equals(state.SubtitleStream.Codec, "ssa", StringComparison.OrdinalIgnoreCase); + var isAssSubtitle = string.Equals(state.SubtitleStream.Codec, "ass", StringComparison.OrdinalIgnoreCase) || string.Equals(state.SubtitleStream.Codec, "ssa", StringComparison.OrdinalIgnoreCase); var task = MediaEncoder.ExtractTextSubtitle(inputPath, type, state.SubtitleStream.Index, isAssSubtitle, path, CancellationToken.None); diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index e61e958f5..10034d7e5 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -110,10 +110,13 @@ namespace MediaBrowser.Controller.Entities return System.IO.Path.GetDirectoryName(Path); } - if (VideoType == VideoType.BluRay || VideoType == VideoType.Dvd || - VideoType == VideoType.HdDvd) + if (!IsPlaceHolder) { - return Path; + if (VideoType == VideoType.BluRay || VideoType == VideoType.Dvd || + VideoType == VideoType.HdDvd) + { + return Path; + } } return base.ContainingFolderPath; @@ -259,10 +262,7 @@ namespace MediaBrowser.Controller.Entities { if (!IsInMixedFolder) { - if (VideoType == VideoType.VideoFile || VideoType == VideoType.Iso) - { - return new[] { System.IO.Path.GetDirectoryName(Path) }; - } + return new[] { ContainingFolderPath }; } return base.GetDeletePaths(); diff --git a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs index b2b9e2af3..184033177 100644 --- a/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs +++ b/MediaBrowser.Controller/MediaEncoding/MediaEncoderHelpers.cs @@ -34,6 +34,7 @@ namespace MediaBrowser.Controller.MediaEncoding { case VideoType.BluRay: type = InputType.Bluray; + inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray(); break; case VideoType.Dvd: type = InputType.Dvd; @@ -46,6 +47,7 @@ namespace MediaBrowser.Controller.MediaEncoding { case IsoType.BluRay: type = InputType.Bluray; + inputPath = GetPlayableStreamFiles(inputPath[0], playableStreamFileNames).ToArray(); break; case IsoType.Dvd: type = InputType.Dvd; @@ -118,15 +120,16 @@ namespace MediaBrowser.Controller.MediaEncoding return type; } - public static Model.Entities.MediaInfo GetMediaInfo(InternalMediaInfoResult data) + public static MediaInfo GetMediaInfo(InternalMediaInfoResult data) { var internalStreams = data.streams ?? new MediaStreamInfo[] { }; - var info = new Model.Entities.MediaInfo(); - - info.MediaStreams = internalStreams.Select(s => GetMediaStream(s, data.format)) - .Where(i => i != null) - .ToList(); + var info = new MediaInfo + { + MediaStreams = internalStreams.Select(s => GetMediaStream(s, data.format)) + .Where(i => i != null) + .ToList() + }; if (data.format != null) { @@ -137,7 +140,7 @@ namespace MediaBrowser.Controller.MediaEncoding } private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); - + /// /// Converts ffprobe stream info to our MediaStream class /// diff --git a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs index e71867b05..25b9c687c 100644 --- a/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs +++ b/MediaBrowser.Server.Implementations/MediaEncoder/MediaEncoder.cs @@ -125,13 +125,11 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder switch (type) { + case InputType.Bluray: case InputType.Dvd: case InputType.File: inputPath = GetConcatInputArgument(inputFiles); break; - case InputType.Bluray: - inputPath = GetBlurayInputArgument(inputFiles[0]); - break; case InputType.Url: inputPath = GetHttpInputArgument(inputFiles); break;