Browse Source

fix explicit audio decoder on combined input (#2582)

pull/2583/head
Jason Dove 2 months ago committed by GitHub
parent
commit
e5ef9be09c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 17
      ErsatzTV.FFmpeg/CommandGenerator.cs
  3. 4
      ErsatzTV.FFmpeg/Decoder/DecoderAacLatm.cs
  4. 4
      ErsatzTV.FFmpeg/Decoder/DecoderDtsCoreOnly.cs

1
CHANGELOG.md

@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix crashes due to invalid smart collection searches, e.g. `smart_collection:"this collection does not exist"`
- Fix UI crash when editing block playout that has default deco
- Fix playback failure when seeking content with certain DTS audio (e.g. DTS-HD MA)
- Properly set explicit audio decoder on combined audio and video input file
## [25.8.0] - 2025-10-26
### Added

17
ErsatzTV.FFmpeg/CommandGenerator.cs

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
using ErsatzTV.FFmpeg.Encoder;
using ErsatzTV.FFmpeg.Decoder;
using ErsatzTV.FFmpeg.Encoder;
using ErsatzTV.FFmpeg.Environment;
using ErsatzTV.FFmpeg.Filter;
using ErsatzTV.FFmpeg.GlobalOption;
@ -27,6 +28,9 @@ public static class CommandGenerator @@ -27,6 +28,9 @@ public static class CommandGenerator
arguments.AddRange(step.GlobalOptions);
}
bool isSameAudioAndVideo = maybeAudioInputFile.IsSome && maybeVideoInputFile.IsSome &&
maybeAudioInputFile.Map(f => f.Path) == maybeVideoInputFile.Map(f => f.Path);
var includedPaths = new System.Collections.Generic.HashSet<string>();
foreach (VideoInputFile videoInputFile in maybeVideoInputFile)
{
@ -37,6 +41,17 @@ public static class CommandGenerator @@ -37,6 +41,17 @@ public static class CommandGenerator
arguments.AddRange(step.InputOptions(videoInputFile));
}
if (isSameAudioAndVideo)
{
foreach (AudioInputFile audioInputFile in maybeAudioInputFile)
{
foreach (IDecoder decoder in audioInputFile.InputOptions.OfType<IDecoder>())
{
arguments.AddRange(decoder.InputOptions(audioInputFile));
}
}
}
arguments.AddRange(["-i", videoInputFile.Path]);
}

4
ErsatzTV.FFmpeg/Decoder/DecoderAacLatm.cs

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
using ErsatzTV.FFmpeg.Environment;
using ErsatzTV.FFmpeg.InputOption;
namespace ErsatzTV.FFmpeg.Decoder;
public class DecoderAacLatm : IInputOption
public class DecoderAacLatm : IDecoder
{
public string Name => "aac_latm";
public EnvironmentVariable[] EnvironmentVariables => [];
public string[] GlobalOptions => [];
public string[] FilterOptions => [];

4
ErsatzTV.FFmpeg/Decoder/DecoderDtsCoreOnly.cs

@ -1,10 +1,10 @@ @@ -1,10 +1,10 @@
using ErsatzTV.FFmpeg.Environment;
using ErsatzTV.FFmpeg.InputOption;
namespace ErsatzTV.FFmpeg.Decoder;
public class DecoderDtsCoreOnly : IInputOption
public class DecoderDtsCoreOnly : IDecoder
{
public string Name => "dts";
public EnvironmentVariable[] EnvironmentVariables => [];
public string[] GlobalOptions => [];
public string[] FilterOptions => [];

Loading…
Cancel
Save