From 47aa07c3424ce0041e0a79eea1ab7f6621485b94 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Fri, 17 Feb 2023 00:26:03 +0100 Subject: [PATCH] Fix DLNA playback of DVD and BD folders --- Jellyfin.Api/Helpers/TranscodingJobHelper.cs | 8 ++++++-- .../Probing/ProbeResultNormalizer.cs | 13 ++++++++++++- MediaBrowser.Model/Dlna/StreamInfo.cs | 6 ++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs index 3bb3ad358f..ee210117e6 100644 --- a/Jellyfin.Api/Helpers/TranscodingJobHelper.cs +++ b/Jellyfin.Api/Helpers/TranscodingJobHelper.cs @@ -325,8 +325,12 @@ public class TranscodingJobHelper : IDisposable await DeletePartialStreamFiles(job.Path!, job.Type, 0, 1500).ConfigureAwait(false); if (job.MediaSource?.VideoType == VideoType.Dvd || job.MediaSource?.VideoType == VideoType.BluRay) { - var path = Path.Join(job.Path, job.MediaSource.Id + ".concat"); - File.Delete(path); + var concatFilePath = Path.Join(_serverConfigurationManager.GetTranscodePath(), job.MediaSource.Id + ".concat"); + if (File.Exists(concatFilePath)) + { + _logger.LogInformation("Deleting ffmpeg concat configuration at {Path}", concatFilePath); + _fileSystem.DeleteFile(concatFilePath); + } } } diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 99310a75dd..dc15e169fa 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -251,12 +251,23 @@ namespace MediaBrowser.MediaEncoding.Probing return null; } + // Handle MPEG-1 container if (string.Equals(format, "mpegvideo", StringComparison.OrdinalIgnoreCase)) { return "mpeg"; } - format = format.Replace("matroska", "mkv", StringComparison.OrdinalIgnoreCase); + // Handle MPEG-2 container + if (string.Equals(format, "mpeg", StringComparison.OrdinalIgnoreCase)) + { + return "ts"; + } + + // Handle matroska container + if (string.Equals(format, "matroska", StringComparison.OrdinalIgnoreCase)) + { + return "mkv"; + } return format; } diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index 3b55099079..fdf3afe973 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -108,8 +108,10 @@ namespace MediaBrowser.Model.Dlna public string MediaSourceId => MediaSource?.Id; public bool IsDirectStream => - PlayMethod == PlayMethod.DirectStream || - PlayMethod == PlayMethod.DirectPlay; + !(MediaSource?.VideoType == VideoType.Dvd + || MediaSource?.VideoType == VideoType.BluRay) + && (PlayMethod == PlayMethod.DirectStream + || PlayMethod == PlayMethod.DirectPlay); /// /// Gets the audio stream that will be used.