2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 11:21:24 +00:00

Set default audio codecs if none are specified

This commit is contained in:
asonix 2024-01-07 10:01:50 -06:00
parent ca34a15cd3
commit 65e165af49

View file

@ -156,10 +156,13 @@ const fn webm_audio(
Some(WebmAudioCodec::Vorbis), Some(WebmAudioCodec::Vorbis),
!matches!(provided, Some(WebmAudioCodec::Vorbis)), !matches!(provided, Some(WebmAudioCodec::Vorbis)),
), ),
_ => (provided, false), _ => match provided {
Some(codec) => (Some(codec), false),
None => (Some(WebmAudioCodec::Opus), true),
},
} }
} else { } else {
(None, false) (None, true)
} }
} }
@ -175,10 +178,13 @@ const fn mp4_audio(
Some(Mp4AudioCodec::Aac), Some(Mp4AudioCodec::Aac),
!matches!(provided, Some(Mp4AudioCodec::Aac)), !matches!(provided, Some(Mp4AudioCodec::Aac)),
), ),
_ => (provided, false), _ => match provided {
Some(codec) => (Some(codec), false),
None => (Some(Mp4AudioCodec::Aac), true),
},
} }
} else { } else {
(None, false) (None, true)
} }
} }