summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Shih <robertshih@google.com>2015-03-30 14:31:03 -0700
committerMarco Nelissen <marcone@google.com>2015-04-03 13:26:31 -0700
commit34630194376f3a0c204dc452f2652859367a6296 (patch)
treed4ab4f9a61ff1c54361da6218e229e4ee89dae5a
parent3170358336dbe466cd3e9a5517e8e579b47cd084 (diff)
downloadframeworks_av-34630194376f3a0c204dc452f2652859367a6296.zip
frameworks_av-34630194376f3a0c204dc452f2652859367a6296.tar.gz
frameworks_av-34630194376f3a0c204dc452f2652859367a6296.tar.bz2
ESQueue:use 0x000001 instead of 0x00000001 as sync word in H264/MPEG_VIDEO
H264/MPEG_VIDEO sync words can be either 0x000001 (3 bytes) or 0x00000001 (4 bytes); simply searching for 0x000001 in appendData suffices because: 1. 0x000001 is a suffix of 0x00000001, as such we would continue to identify all sync words that we used to identify originally. 2. the parsing logic downstream of appendData in dequeueAccessUnitMPEGVideo and dequeueAccessUnitH264 can both handle 0x000001. Bug: 19900317 Change-Id: Iac42aad74563d056a443b4396eacbae0f7a4738b
-rw-r--r--media/libstagefright/mpeg2ts/ESQueue.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libstagefright/mpeg2ts/ESQueue.cpp b/media/libstagefright/mpeg2ts/ESQueue.cpp
index a605595..f257289 100644
--- a/media/libstagefright/mpeg2ts/ESQueue.cpp
+++ b/media/libstagefright/mpeg2ts/ESQueue.cpp
@@ -257,8 +257,8 @@ status_t ElementaryStreamQueue::appendData(
uint8_t *ptr = (uint8_t *)data;
ssize_t startOffset = -1;
- for (size_t i = 0; i + 3 < size; ++i) {
- if (!memcmp("\x00\x00\x00\x01", &ptr[i], 4)) {
+ for (size_t i = 0; i + 2 < size; ++i) {
+ if (!memcmp("\x00\x00\x01", &ptr[i], 3)) {
startOffset = i;
break;
}