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.
This commit is contained in:
@@ -725,6 +725,14 @@ void MPEG2TSWriter::writeAccessUnit(
|
|||||||
|
|
||||||
size_t PES_packet_length = accessUnit->size() + 8;
|
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();
|
uint8_t *ptr = buffer->data();
|
||||||
*ptr++ = 0x47;
|
*ptr++ = 0x47;
|
||||||
*ptr++ = 0x40 | (PID >> 8);
|
*ptr++ = 0x40 | (PID >> 8);
|
||||||
|
|||||||
Reference in New Issue
Block a user