diff options
author | Robert Shih <robertshih@google.com> | 2015-03-30 14:31:03 -0700 |
---|---|---|
committer | Robert Shih <robertshih@google.com> | 2015-04-01 14:55:19 -0700 |
commit | 13561c89d6d8f6980625192bd75f9fd6cfb102a3 (patch) | |
tree | 7b1cb47146b9df03f1e23e487c220dcc03a38522 /media/libstagefright/mpeg2ts | |
parent | 377165c24968b044faccaf366a2377fa32143e2f (diff) | |
download | frameworks_av-13561c89d6d8f6980625192bd75f9fd6cfb102a3.zip frameworks_av-13561c89d6d8f6980625192bd75f9fd6cfb102a3.tar.gz frameworks_av-13561c89d6d8f6980625192bd75f9fd6cfb102a3.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
Diffstat (limited to 'media/libstagefright/mpeg2ts')
-rw-r--r-- | media/libstagefright/mpeg2ts/ESQueue.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libstagefright/mpeg2ts/ESQueue.cpp b/media/libstagefright/mpeg2ts/ESQueue.cpp index 88da275..b17985c 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; } |