Backport pull request #11754 from jellyfin/release-10.9.z

Fix BD/DVD folder chapter image extraction

Original-merge: 52be8be28f

Merged-by: Bond-009 <bond.009@outlook.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
pull/11835/head
Shadowghost 6 months ago committed by Joshua M. Boniface
parent c3091b75a3
commit debd9eb8ce

@ -680,16 +680,6 @@ namespace MediaBrowser.Controller.MediaEncoding
return -1; return -1;
} }
public string GetInputPathArgument(EncodingJobInfo state)
{
return state.MediaSource.VideoType switch
{
VideoType.Dvd => _mediaEncoder.GetInputArgument(_mediaEncoder.GetPrimaryPlaylistVobFiles(state.MediaPath, null).ToList(), state.MediaSource),
VideoType.BluRay => _mediaEncoder.GetInputArgument(_mediaEncoder.GetPrimaryPlaylistM2tsFiles(state.MediaPath).ToList(), state.MediaSource),
_ => _mediaEncoder.GetInputArgument(state.MediaPath, state.MediaSource)
};
}
/// <summary> /// <summary>
/// Gets the audio encoder. /// Gets the audio encoder.
/// </summary> /// </summary>
@ -1203,7 +1193,7 @@ namespace MediaBrowser.Controller.MediaEncoding
else else
{ {
arg.Append(" -i ") arg.Append(" -i ")
.Append(GetInputPathArgument(state)); .Append(_mediaEncoder.GetInputPathArgument(state));
} }
// sub2video for external graphical subtitles // sub2video for external graphical subtitles

@ -245,6 +245,21 @@ namespace MediaBrowser.Controller.MediaEncoding
/// <returns>A playlist.</returns> /// <returns>A playlist.</returns>
IReadOnlyList<string> GetPrimaryPlaylistM2tsFiles(string path); IReadOnlyList<string> GetPrimaryPlaylistM2tsFiles(string path);
/// <summary>
/// Gets the input path argument from <see cref="EncodingJobInfo"/>.
/// </summary>
/// <param name="state">The <see cref="EncodingJobInfo"/>.</param>
/// <returns>The input path argument.</returns>
string GetInputPathArgument(EncodingJobInfo state);
/// <summary>
/// Gets the input path argument.
/// </summary>
/// <param name="path">The item path.</param>
/// <param name="mediaSource">The <see cref="MediaSourceInfo"/>.</param>
/// <returns>The input path argument.</returns>
string GetInputPathArgument(string path, MediaSourceInfo mediaSource);
/// <summary> /// <summary>
/// Generates a FFmpeg concat config for the source. /// Generates a FFmpeg concat config for the source.
/// </summary> /// </summary>

@ -30,10 +30,8 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.MediaInfo;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using static Nikse.SubtitleEdit.Core.Common.IfoParser;
namespace MediaBrowser.MediaEncoding.Encoder namespace MediaBrowser.MediaEncoding.Encoder
{ {
@ -621,7 +619,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
ImageFormat? targetFormat, ImageFormat? targetFormat,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
var inputArgument = GetInputArgument(inputFile, mediaSource); var inputArgument = GetInputPathArgument(inputFile, mediaSource);
if (!isAudio) if (!isAudio)
{ {
@ -1147,6 +1145,21 @@ namespace MediaBrowser.MediaEncoding.Encoder
.ToList(); .ToList();
} }
/// <inheritdoc />
public string GetInputPathArgument(EncodingJobInfo state)
=> GetInputPathArgument(state.MediaPath, state.MediaSource);
/// <inheritdoc />
public string GetInputPathArgument(string path, MediaSourceInfo mediaSource)
{
return mediaSource.VideoType switch
{
VideoType.Dvd => GetInputArgument(GetPrimaryPlaylistVobFiles(path, null).ToList(), mediaSource),
VideoType.BluRay => GetInputArgument(GetPrimaryPlaylistM2tsFiles(path).ToList(), mediaSource),
_ => GetInputArgument(path, mediaSource)
};
}
/// <inheritdoc /> /// <inheritdoc />
public void GenerateConcatConfig(MediaSourceInfo source, string concatFilePath) public void GenerateConcatConfig(MediaSourceInfo source, string concatFilePath)
{ {

Loading…
Cancel
Save