[Live-devel] Question about MultiFramedRTPSource.cpp

Pearson, Christopherx C christopherx.c.pearson at intel.com
Thu Dec 4 22:16:57 PST 2003


It appears to me that the BufferedPacket::use() method can truncate RTP
packets that do not fit in the caller's buffer passed to getNextFrame().
Specifically, in LIVE.com release 2003.08.07,
MultiFramedRTPSource.cpp:348 reads:

  fHead += (newFramePtr - origFramePtr) + frameSize;

Since only 'bytesUsed' bytes were copied to the caller's buffer, I think
the line should read:

  fHead += (newFramePtr - origFramePtr) + bytesUsed;

Otherwise, when 'frameSize' exceeds 'bytesUsed', 'frameSize - bytesUsed'
bytes are skipped, and the current packet is released from the
reordering buffer.

Anyway, making this change enabled LIVE.com to return multiple RTP
packets in each buffer.  That may not be desirable for other payload
types, but for MP2T and MP2P, which are not framed, it is what I wanted
-- it reduced CPU usage significantly.

However, one problem is that I'm abusing the default marker-bit rule,
which takes the marker-bit to mean end-of-frame, when in fact it
signifies a discontinuity (start-of-segment essentially) for the
aforementioned payload types.  That may not be a problem in cases where
the discontinuity is also marked at the TS level.  I'll probably have to
override something (BufferedPacket::nextEnclosedFrameSize?) to do this
right.

Has anyone else encountered this problem?  Am I missing something here?
Comments/correction appreciated!

-- Chris Pearson




More information about the live-devel mailing list