summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-05-17 10:31:58 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-17 10:31:58 -0700
commit44ade918fd2e82db86a2f0aeb49229950e78822b (patch)
treeec5bbc580685f911590804b2bab3cee958848e9c /media/libstagefright
parent9e9bcb2c0c8e28291775138344cc687b3e6e92ef (diff)
parent70361bfe567cc86343126a7ca2f92cb109711aa0 (diff)
downloadframeworks_av-44ade918fd2e82db86a2f0aeb49229950e78822b.zip
frameworks_av-44ade918fd2e82db86a2f0aeb49229950e78822b.tar.gz
frameworks_av-44ade918fd2e82db86a2f0aeb49229950e78822b.tar.bz2
am c56e81c8: Merge "DO NOT MERGE: Properly construct the ESDS metadata even if sizeof(codec-specific-data) != 2" into honeycomb-mr2
* commit 'c56e81c88706d79ce51a314b5bfd3e247ca6f86c': DO NOT MERGE: Properly construct the ESDS metadata even if sizeof(codec-specific-data) != 2
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/matroska/MatroskaExtractor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/media/libstagefright/matroska/MatroskaExtractor.cpp b/media/libstagefright/matroska/MatroskaExtractor.cpp
index 733de92..642835a 100644
--- a/media/libstagefright/matroska/MatroskaExtractor.cpp
+++ b/media/libstagefright/matroska/MatroskaExtractor.cpp
@@ -660,7 +660,8 @@ static void addESDSFromAudioSpecificInfo(
// 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;
uint8_t *esds = new uint8_t[esdsSize];
memcpy(esds, kStaticESDS, sizeof(kStaticESDS));
@@ -668,6 +669,11 @@ static void addESDSFromAudioSpecificInfo(
*ptr++ = 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);
delete[] esds;