Skip to content

mp4a: Support QT sound sample description version 1. #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/mp4box/mp4a.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,22 @@ impl<R: Read + Seek> ReadBox<&mut R> for Mp4aBox {
reader.read_u16::<BigEndian>()?; // reserved
let data_reference_index = reader.read_u16::<BigEndian>()?;

reader.read_u64::<BigEndian>()?; // reserved
// Next 8 bytes should be all 0 in ISO MP4
let qt_version = reader.read_u16::<BigEndian>()?; // QT: 0, 1 or 2
reader.read_u16::<BigEndian>()?; // QT: revision level, should be 0
reader.read_u32::<BigEndian>()?; // QT: vendor, should be 0

let channelcount = reader.read_u16::<BigEndian>()?;
let samplesize = reader.read_u16::<BigEndian>()?;
reader.read_u32::<BigEndian>()?; // pre-defined, reserved
let samplerate = FixedPointU16::new_raw(reader.read_u32::<BigEndian>()?);

if qt_version == 1 {
// Samples per packet, bytes per packet,
// bytes per frame, bytes per sample
skip_bytes(reader, 4 * 4)?;
}

let mut esds = None;
let current = reader.stream_position()?;
if current < start + size {
Expand Down