diff --git a/go_backend/library_scan_formats.go b/go_backend/library_scan_formats.go index 26d46dc4..23dade0b 100644 --- a/go_backend/library_scan_formats.go +++ b/go_backend/library_scan_formats.go @@ -258,6 +258,8 @@ func libraryFormatForM4ACodec(codec string) string { return "ac3" case "ac4", "ac-4": return "ac4" + case "opus": + return "opus" case "aac", "mp4a": return "m4a" default: diff --git a/go_backend/metadata_m4a.go b/go_backend/metadata_m4a.go index 39492c69..bbd788f8 100644 --- a/go_backend/metadata_m4a.go +++ b/go_backend/metadata_m4a.go @@ -842,6 +842,8 @@ func normalizeM4AAudioCodec(atomType string) string { return "ac3" case "ac-4": return "ac4" + case "Opus": + return "opus" default: return strings.TrimSpace(atomType) } diff --git a/go_backend/metadata_m4a_quality_test.go b/go_backend/metadata_m4a_quality_test.go index 1d9a64f6..e17862a7 100644 --- a/go_backend/metadata_m4a_quality_test.go +++ b/go_backend/metadata_m4a_quality_test.go @@ -56,6 +56,7 @@ func TestM4ACodecFormatMapping(t *testing.T) { "ec-3": "eac3", "ac-3": "ac3", "ac-4": "ac4", + "Opus": "opus", } for atomType, want := range cases { if got := normalizeM4AAudioCodec(atomType); got != want { @@ -69,6 +70,9 @@ func TestM4ACodecFormatMapping(t *testing.T) { if got := libraryFormatForM4ACodec("eac3"); got != "eac3" { t.Fatalf("libraryFormatForM4ACodec(eac3) = %q", got) } + if got := libraryFormatForM4ACodec("Opus"); got != "opus" { + t.Fatalf("libraryFormatForM4ACodec(Opus) = %q", got) + } if got := libraryFormatForM4ACodec("aac"); got != "m4a" { t.Fatalf("libraryFormatForM4ACodec(aac) = %q", got) }