Skip to content

Commit 87813e7

Browse files
committed
MP4/M4A : Add ec-3 (Dolby Digital Plus) to valid audio descriptors
1 parent 1848aac commit 87813e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ATL/AudioData/IO/MP4.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class MP4 : MetaDataIO, IAudioDataIO
3939

4040
private static readonly byte[] ILST_CORE_SIGNATURE = { 0, 0, 0, 8, 105, 108, 115, 116 }; // (int32)8 followed by "ilst" field code
4141

42+
private static readonly ISet<string> VALID_AUDIO_DESCRIPTORS = new HashSet<string> { "mp4a", "enca", "samr", "alac", "sawb", "Opus", "ec-3" };
43+
4244
private const string ZONE_MP4_NOUDTA = "noudta"; // Placeholder for missing 'udta' atom
4345
private const string ZONE_MP4_NOMETA = "nometa"; // Placeholder for missing 'meta' atom
4446
private const string ZONE_MP4_ILST = "ilst"; // When editing a file with an existing 'meta' atom
@@ -840,7 +842,7 @@ long moovSize
840842
string descFormat = Utils.Latin1Encoding.GetString(data32);
841843

842844
// Descriptors for audio
843-
if (descFormat.Equals("mp4a") || descFormat.Equals("enca") || descFormat.Equals("samr") || descFormat.Equals("alac") || descFormat.Equals("sawb") || descFormat.Equals("Opus"))
845+
if (VALID_AUDIO_DESCRIPTORS.Contains(descFormat))
844846
{
845847
source.Seek(6, SeekOrigin.Current); // SampleEntry / 6-byte reserved zone set to zero
846848
source.Seek(2, SeekOrigin.Current); // SampleEntry / Data reference index

0 commit comments

Comments
 (0)