prioritize default audio streams (#1154)

This commit is contained in:
Jason Dove
2023-02-10 09:31:55 -06:00
committed by GitHub
parent 6429f0f064
commit 0eb36f0ce1
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -20,6 +20,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- 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
### Added
+3 -3
View File
@@ -233,7 +233,7 @@ public class FFmpegStreamSelector : IFFmpegStreamSelector
if (string.IsNullOrWhiteSpace(title))
{
_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
@@ -247,14 +247,14 @@ public class FFmpegStreamSelector : IFFmpegStreamSelector
matchingTitle.Count,
title);
return matchingTitle.OrderByDescending(s => s.Channels).Head();
return matchingTitle.OrderByDescending(s => s.Channels).ThenByDescending(s => s.Default).Head();
}
_logger.LogDebug(
"Unable to find audio stream with preferred title {Title}; selecting stream with most channels",
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(