From 2ff8dc6b6e4080793cea3f7c92faee2e914a6f57 Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Sat, 10 Aug 2024 11:53:40 -0400 Subject: [PATCH] EBML: Define more master elements --- lofty/src/ebml/element_reader.rs | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/lofty/src/ebml/element_reader.rs b/lofty/src/ebml/element_reader.rs index 3e0346fe..0681434b 100644 --- a/lofty/src/ebml/element_reader.rs +++ b/lofty/src/ebml/element_reader.rs @@ -90,6 +90,7 @@ ebml_master_elements! { EBMLMaxIDLength: { 0x42F2, UnsignedInt }, EBMLMaxSizeLength: { 0x42F3, UnsignedInt }, DocType: { 0x4282, String }, + DocTypeExtension: { 0x4281, Master }, DocTypeVersion: { 0x4287, UnsignedInt }, DocTypeReadVersion: { 0x4285, UnsignedInt }, ], @@ -106,6 +107,7 @@ ebml_master_elements! { Segment: { id: 0x1853_8067, children: [ + SeekHead: { 0x114D_9B74, Master }, Info: { 0x1549_A966, Master }, Cluster: { 0x1F43_B675, Master }, Tracks: { 0x1654_AE6B, Master }, @@ -115,6 +117,14 @@ ebml_master_elements! { ], }, + // segment.seekHead + SeekHead: { + id: 0x114D_9B74, + children: [ + Seek: { 0x4DBB, Master }, + ], + }, + // segment.info Info: { id: 0x1549_A966, @@ -140,22 +150,29 @@ ebml_master_elements! { TrackType: { 0x83, UnsignedInt }, FlagEnabled: { 0xB9, UnsignedInt }, FlagDefault: { 0x88, UnsignedInt }, - FlagLacing: { 0x9C, UnsignedInt }, DefaultDuration: { 0x23E3_83, UnsignedInt }, TrackTimecodeScale: { 0x2331_59, Float }, - MaxBlockAdditionID: { 0x55EE, UnsignedInt }, Language: { 0x22B5_9C, String }, CodecID: { 0x86, String }, + CodecName: { 0x258688, Utf8 }, CodecDelay: { 0x56AA, UnsignedInt }, SeekPreRoll: { 0x56BB, UnsignedInt }, - TrackTranslate: { 0x6624, Master }, - Video: { 0xE0, Master }, Audio: { 0xE1, Master }, - TrackOperation: { 0xE2, Master }, - ContentEncodings: { 0x6D80, Master }, ], }, + // segment.tracks.trackEntry.audio + Audio: { + id: 0xE1, + children: [ + SamplingFrequency: { 0xB5, Float }, + OutputSamplingFrequency: { 0x78B5, Float }, + Channels: { 0x9F, UnsignedInt }, + BitDepth: { 0x6264, UnsignedInt }, + ], + }, + + // segment.tags Tags: { id: 0x1254_C367,