Fix --default-subtitle causing no such file error (#98)

This commit is contained in:
ByteDream 2023-01-06 00:03:57 +01:00
parent 404aa496e1
commit 892407d1f0

View file

@ -632,10 +632,10 @@ fn generate_mkv(
if let Some(default_subtitle) = &archive.default_subtitle { if let Some(default_subtitle) = &archive.default_subtitle {
// if `--default_subtitle <locale>` is given set the default subtitle to the given locale // if `--default_subtitle <locale>` is given set the default subtitle to the given locale
if let Some(position) = subtitle_paths if let Some(position) = subtitle_paths
.into_iter() .iter()
.position(|s| &s.1.locale == default_subtitle) .position(|(_, subtitle)| &subtitle.locale == default_subtitle)
{ {
command_args.push(format!("-disposition:s:{}", position)) command_args.extend([format!("-disposition:s:{}", position), "default".to_string()])
} else { } else {
command_args.extend(["-disposition:s:0".to_string(), "0".to_string()]) command_args.extend(["-disposition:s:0".to_string(), "0".to_string()])
} }