Skip to content

Commit

Permalink
Add fLaC prefix to FLAC initialization data
Browse files Browse the repository at this point in the history
The fLaC prefix is included in the initialization data output
from the MKV extractor, so this is highly likely ot be the
right thing to do.

Issue: #6397
PiperOrigin-RevId: 268244365
  • Loading branch information
ojw28 committed Sep 10, 2019
1 parent 755b4a2 commit 0706625
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,16 @@ private static void parseAudioSampleEntry(ParsableByteArray parent, int atomType
System.arraycopy(opusMagic, 0, initializationData, 0, opusMagic.length);
parent.setPosition(childPosition + Atom.HEADER_SIZE);
parent.readBytes(initializationData, opusMagic.length, childAtomBodySize);
} else if (childAtomType == Atom.TYPE_dfLa || childAtomType == Atom.TYPE_alac) {
} else if (childAtomType == Atom.TYPE_dfLa) {
int childAtomBodySize = childAtomSize - Atom.FULL_HEADER_SIZE;
initializationData = new byte[4 + childAtomBodySize];
initializationData[0] = 0x66; // f
initializationData[1] = 0x4C; // L
initializationData[2] = 0x61; // a
initializationData[3] = 0x43; // C
parent.setPosition(childPosition + Atom.FULL_HEADER_SIZE);
parent.readBytes(initializationData, /* offset= */ 4, childAtomBodySize);
} else if (childAtomType == Atom.TYPE_alac) {
int childAtomBodySize = childAtomSize - Atom.FULL_HEADER_SIZE;
initializationData = new byte[childAtomBodySize];
parent.setPosition(childPosition + Atom.FULL_HEADER_SIZE);
Expand Down

0 comments on commit 0706625

Please sign in to comment.