Skip to content

Commit c537bae

Browse files
committed
Don't fail when the wave atom contains different atoms than esds
1 parent 8d6e19e commit c537bae

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

mp4parse/src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5737,9 +5737,15 @@ fn read_audio_sample_entry<T: Read>(src: &mut BMFFBox<T>) -> Result<SampleEntry>
57375737
codec_specific = Some(AudioCodecSpecific::ALACSpecificBox(alac));
57385738
}
57395739
BoxType::QTWaveAtom => {
5740-
let qt_esds = read_qt_wave_atom(&mut b)?;
5741-
codec_type = qt_esds.audio_codec;
5742-
codec_specific = Some(AudioCodecSpecific::ES_Descriptor(qt_esds));
5740+
match read_qt_wave_atom(&mut b) {
5741+
Ok(qt_esds) => {
5742+
codec_type = qt_esds.audio_codec;
5743+
codec_specific = Some(AudioCodecSpecific::ES_Descriptor(qt_esds));
5744+
},
5745+
Err(e) => {
5746+
warn!("Failed to parse wave atom: {e:?}");
5747+
}
5748+
}
57435749
}
57445750
BoxType::ProtectionSchemeInfoBox => {
57455751
if name != BoxType::ProtectedAudioSampleEntry {

0 commit comments

Comments
 (0)