Fall back to first audio track when none preferred
Auto-selection still prefers Japanese/Chinese/undefined audio, but if a file has none of those (e.g. only English), the first audio track is pre-checked instead of leaving no audio track selected.
This commit is contained in:
@@ -93,9 +93,12 @@ public class MkvService
|
||||
|
||||
/// <summary>
|
||||
/// Builds the list of <see cref="TrackItem"/> objects for a file. Video
|
||||
/// tracks are always pre-checked. Exactly one audio track is pre-checked:
|
||||
/// among Japanese/Chinese/undefined-language tracks, a stereo (2-channel)
|
||||
/// track is preferred, otherwise the first matching track in file order.
|
||||
/// tracks are always pre-checked. Exactly one audio track is always
|
||||
/// pre-checked: among Japanese/Chinese/undefined-language tracks, a
|
||||
/// stereo (2-channel) track is preferred, otherwise the first matching
|
||||
/// track in file order. If no such track exists (e.g. only English
|
||||
/// audio), the very first audio track in the file is pre-checked instead,
|
||||
/// so a file is never left with no audio track selected.
|
||||
/// Subtitle tracks are never pre-checked — the user picks one via the
|
||||
/// track table, and the choice propagates to other queued files.
|
||||
/// </summary>
|
||||
@@ -108,7 +111,8 @@ public class MkvService
|
||||
.ToList();
|
||||
|
||||
MkvTrack? preferredAudio = eligibleAudio.FirstOrDefault(t => t.Properties?.AudioChannels == 2)
|
||||
?? eligibleAudio.FirstOrDefault();
|
||||
?? eligibleAudio.FirstOrDefault()
|
||||
?? audioTracks.FirstOrDefault();
|
||||
|
||||
var items = info.Tracks.Select(t =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user