Browse Source

prioritize default audio streams (#1154)

pull/1156/head
Jason Dove 4 years ago committed by GitHub
parent
commit
0eb36f0ce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 6
      ErsatzTV.Core/FFmpeg/FFmpegStreamSelector.cs

2
CHANGELOG.md

@ -20,6 +20,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed ### Changed
- Merge generated `Other Video` folder tags with tags from sidecar NFO - Merge generated `Other Video` folder tags with tags from sidecar NFO
- Prioritize audio streams that are flagged as "default" when multiple candidate streams are available
- For example, a video with a stereo commentary track and a stereo "default" track will now prefer the "default" track
## [0.7.3-beta] - 2023-01-25 ## [0.7.3-beta] - 2023-01-25
### Added ### Added

6
ErsatzTV.Core/FFmpeg/FFmpegStreamSelector.cs

@ -233,7 +233,7 @@ public class FFmpegStreamSelector : IFFmpegStreamSelector
if (string.IsNullOrWhiteSpace(title)) if (string.IsNullOrWhiteSpace(title))
{ {
_logger.LogDebug("No audio title has been specified; selecting stream with most channels"); _logger.LogDebug("No audio title has been specified; selecting stream with most channels");
return streams.OrderByDescending(s => s.Channels).Head(); return streams.OrderByDescending(s => s.Channels).ThenByDescending(s => s.Default).Head();
} }
// prioritize matching titles // prioritize matching titles
@ -247,14 +247,14 @@ public class FFmpegStreamSelector : IFFmpegStreamSelector
matchingTitle.Count, matchingTitle.Count,
title); title);
return matchingTitle.OrderByDescending(s => s.Channels).Head(); return matchingTitle.OrderByDescending(s => s.Channels).ThenByDescending(s => s.Default).Head();
} }
_logger.LogDebug( _logger.LogDebug(
"Unable to find audio stream with preferred title {Title}; selecting stream with most channels", "Unable to find audio stream with preferred title {Title}; selecting stream with most channels",
title); title);
return streams.OrderByDescending(s => s.Channels).Head(); return streams.OrderByDescending(s => s.Channels).ThenByDescending(s => s.Default).Head();
} }
private async Task<Option<MediaStream>> SelectEpisodeAudioStream( private async Task<Option<MediaStream>> SelectEpisodeAudioStream(

Loading…
Cancel
Save