[Live-devel] PES Packet length problem

Ross Finlayson finlayson at live555.com
Fri Sep 8 06:09:31 PDT 2006


>Hello
>
>In function InputESSourceRecord::deliverBufferToClient() there is the
>following code
>
>unsigned PES_packet_length = fInputBufferBytesAvailable - 6;
>fInputBuffer[4] = PES_packet_length>>8;
>fInputBuffer[5] = PES_packet_length;
>
>In the case that PES_packet_length exceeds 65536 the packet length will
>be recorded incorrectly.
>It is quite possible within the existing framework to exceed a value of
>65536

Not if your input data is correct.

According to the MPEG specifications, the maximum size of a PES 
packet is 6+65535.  If the input to your 
"MPEG2TransportStreamFromPESSource" object delivers data in chunks 
greater than this, then you'll need to fix this.

(However, I agree that the current code should print out a warning 
message if "PES_packet_length" gets to big.)

-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list