fix(download): normalize MP4 audio extension by codec (#512)

This commit is contained in:
zarzet committed 2026-08-11 19:07:00 +07:00
1 parent 4693e2f1d2
commit 5374883875
6 files changed
+146 -13

No files matched your search

+8
View File
@@ -118,6 +118,14 @@ String? normalizeAudioFormatValue(String? value) {
};
}
/// Chooses the user-facing extension for an audio-only ISO-BMFF container.
/// AC-4 stays `.mp4` because its compatibility repair and passthrough path
/// depend on that container identity; other audio codecs use the conventional
/// `.m4a` extension, including Opus and E-AC-3 streams carried inside MP4.
String isoBmffAudioExtensionForCodec(String? codec) {
return normalizeAudioFormatValue(codec) == 'ac4' ? '.mp4' : '.m4a';
}
/// Resolves the actual audio codec reported by native metadata probing, while
/// falling back to the container format when the codec is absent or generic.
///