Add fLaC prefix to FLAC initialization data

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
This commit is contained in:
olly 2019-09-10 17:42:15 +01:00 committed by Oliver Woodman
parent b9ffea6831
commit 23ddfaa80a
2 changed files with 12 additions and 2 deletions

View File

@ -14,7 +14,8 @@
* Add `HttpDataSource.getResponseCode` to provide the status code associated * Add `HttpDataSource.getResponseCode` to provide the status code associated
with the most recent HTTP response. with the most recent HTTP response.
* Fix initialization data handling for FLAC in MP4 * Fix initialization data handling for FLAC in MP4
([#6396](https://github.com/google/ExoPlayer/issues/6396)). ([#6396](https://github.com/google/ExoPlayer/issues/6396),
[#6397](https://github.com/google/ExoPlayer/issues/6397)).
* Fix audio selection issue where languages are compared by bit rate * Fix audio selection issue where languages are compared by bit rate
([#6335](https://github.com/google/ExoPlayer/issues/6335)). ([#6335](https://github.com/google/ExoPlayer/issues/6335)).
* Fix decoder selection for E-AC3 JOC streams * Fix decoder selection for E-AC3 JOC streams

View File

@ -1148,7 +1148,16 @@ import java.util.List;
System.arraycopy(opusMagic, 0, initializationData, 0, opusMagic.length); System.arraycopy(opusMagic, 0, initializationData, 0, opusMagic.length);
parent.setPosition(childPosition + Atom.HEADER_SIZE); parent.setPosition(childPosition + Atom.HEADER_SIZE);
parent.readBytes(initializationData, opusMagic.length, childAtomBodySize); 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; int childAtomBodySize = childAtomSize - Atom.FULL_HEADER_SIZE;
initializationData = new byte[childAtomBodySize]; initializationData = new byte[childAtomBodySize];
parent.setPosition(childPosition + Atom.FULL_HEADER_SIZE); parent.setPosition(childPosition + Atom.FULL_HEADER_SIZE);