diff options
author | Andreas Huber <andih@google.com> | 2010-10-18 11:24:05 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-10-18 11:24:05 -0700 |
commit | 232c33806f6e839a7db76f645d52b5647e097f8c (patch) | |
tree | f2e4b4a6f3c35a505a9132218fba9aae8df5a8c5 | |
parent | 06fa2bcce5dd80b406a23f980d8c9fac1524ebfd (diff) | |
parent | acc82a3bad22af17008a839d993e3bd7a5d9b5af (diff) | |
download | frameworks_av-232c33806f6e839a7db76f645d52b5647e097f8c.zip frameworks_av-232c33806f6e839a7db76f645d52b5647e097f8c.tar.gz frameworks_av-232c33806f6e839a7db76f645d52b5647e097f8c.tar.bz2 |
am 02ec432e: Merge "If the PES packet size exceeds 16-bit range, use a packet size of 0 instead. This is valid for video content according to the specs." into gingerbread
Merge commit '02ec432e6eff2ab59165c5b7c9b1a0d6689d0823' into gingerbread-plus-aosp
* commit '02ec432e6eff2ab59165c5b7c9b1a0d6689d0823':
If the PES packet size exceeds 16-bit range, use a packet size of 0 instead. This is valid for video content according to the specs.
-rw-r--r-- | media/libstagefright/MPEG2TSWriter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG2TSWriter.cpp b/media/libstagefright/MPEG2TSWriter.cpp index b3daf67..81a2b0d 100644 --- a/media/libstagefright/MPEG2TSWriter.cpp +++ b/media/libstagefright/MPEG2TSWriter.cpp @@ -725,6 +725,14 @@ void MPEG2TSWriter::writeAccessUnit( size_t PES_packet_length = accessUnit->size() + 8; + if (PES_packet_length >= 65536) { + // This really should only happen for video. + CHECK_EQ(stream_id, 0xe0u); + + // It's valid to set this to 0 for video according to the specs. + PES_packet_length = 0; + } + uint8_t *ptr = buffer->data(); *ptr++ = 0x47; *ptr++ = 0x40 | (PID >> 8); |