Merge "DO NOT MERGE: Properly construct the ESDS metadata even if sizeof(codec-specific-data) != 2" into honeycomb-mr2
This commit is contained in:
committed by
Android (Google) Code Review
commit
c56e81c887
@ -660,7 +660,8 @@ static void addESDSFromAudioSpecificInfo(
|
|||||||
// AudioSpecificInfo (with size prefix) follows
|
// AudioSpecificInfo (with size prefix) follows
|
||||||
};
|
};
|
||||||
|
|
||||||
CHECK(asiSize < 128);
|
// Make sure all sizes can be coded in a single byte.
|
||||||
|
CHECK(asiSize + 22 - 2 < 128);
|
||||||
size_t esdsSize = sizeof(kStaticESDS) + asiSize + 1;
|
size_t esdsSize = sizeof(kStaticESDS) + asiSize + 1;
|
||||||
uint8_t *esds = new uint8_t[esdsSize];
|
uint8_t *esds = new uint8_t[esdsSize];
|
||||||
memcpy(esds, kStaticESDS, sizeof(kStaticESDS));
|
memcpy(esds, kStaticESDS, sizeof(kStaticESDS));
|
||||||
@ -668,6 +669,11 @@ static void addESDSFromAudioSpecificInfo(
|
|||||||
*ptr++ = asiSize;
|
*ptr++ = asiSize;
|
||||||
memcpy(ptr, asi, asiSize);
|
memcpy(ptr, asi, asiSize);
|
||||||
|
|
||||||
|
// Increment by codecPrivateSize less 2 bytes that are accounted for
|
||||||
|
// already in lengths of 22/17
|
||||||
|
esds[1] += asiSize - 2;
|
||||||
|
esds[6] += asiSize - 2;
|
||||||
|
|
||||||
meta->setData(kKeyESDS, 0, esds, esdsSize);
|
meta->setData(kKeyESDS, 0, esds, esdsSize);
|
||||||
|
|
||||||
delete[] esds;
|
delete[] esds;
|
||||||
|
Reference in New Issue
Block a user