summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-05-17 12:12:39 -0700
committerAndreas Huber <andih@google.com>2012-05-17 12:12:39 -0700
commit8647bbe4420ca487467318404127f52c567e346b (patch)
tree6c6f23d84034a5e4ca0aee0542707bd0bca70570 /media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
parentcd28dc10d49c359566c69d48a29a6f0d3eefa6d9 (diff)
downloadframeworks_av-8647bbe4420ca487467318404127f52c567e346b.zip
frameworks_av-8647bbe4420ca487467318404127f52c567e346b.tar.gz
frameworks_av-8647bbe4420ca487467318404127f52c567e346b.tar.bz2
Prefix MPEG4-generic audio data with ADTS headers
to work around limitations of the new AAC decoder. Change-Id: I4988c7c39fedb7d04eb1ae2ba2d618aa6cb14e77 related-to-bug: 6488547
Diffstat (limited to 'media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp')
-rw-r--r--media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp b/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
index 24c2f30..f9a44f0 100644
--- a/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
+++ b/media/libstagefright/rtsp/AMPEG4AudioAssembler.cpp
@@ -534,27 +534,7 @@ void AMPEG4AudioAssembler::submitAccessUnit() {
LOG(VERBOSE) << "Access unit complete (" << mPackets.size() << " packets)";
#endif
- size_t totalSize = 0;
- List<sp<ABuffer> >::iterator it = mPackets.begin();
- while (it != mPackets.end()) {
- const sp<ABuffer> &unit = *it;
-
- totalSize += unit->size();
- ++it;
- }
-
- sp<ABuffer> accessUnit = new ABuffer(totalSize);
- size_t offset = 0;
- it = mPackets.begin();
- while (it != mPackets.end()) {
- const sp<ABuffer> &unit = *it;
-
- memcpy((uint8_t *)accessUnit->data() + offset,
- unit->data(), unit->size());
-
- ++it;
- }
-
+ sp<ABuffer> accessUnit = MakeCompoundFromPackets(mPackets);
accessUnit = removeLATMFraming(accessUnit);
CopyTimes(accessUnit, *mPackets.begin());