summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2010-10-19 09:51:56 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-10-19 09:51:56 -0700
commit9969c0b798ad81764b67f5a098f7c417b82dcc89 (patch)
tree54c87272aeb4bba449b499d728a6da775aa3076e /media/libstagefright
parentc540e63b50c214ccb0eabc93806a64c5b145d110 (diff)
parent232c33806f6e839a7db76f645d52b5647e097f8c (diff)
downloadframeworks_av-9969c0b798ad81764b67f5a098f7c417b82dcc89.zip
frameworks_av-9969c0b798ad81764b67f5a098f7c417b82dcc89.tar.gz
frameworks_av-9969c0b798ad81764b67f5a098f7c417b82dcc89.tar.bz2
am 8f5214eb: 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 '8f5214eb6fa6c85c9c6703da15c4a6cf95ac4b17' * commit '8f5214eb6fa6c85c9c6703da15c4a6cf95ac4b17': 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.
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/MPEG2TSWriter.cpp8
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);