[Live-devel] whether is a bug in function RTPInterface::handleRead in RTP over RTSP scenario

张世勇 shiyong.zhang.cn at gmail.com
Sat Apr 7 07:09:29 PDT 2012


Hi

In function  RTPInterface::handleRead (version 2012/04/04),

225  if (fNextTCPReadStreamSocketNum < 0) {
226       // Normal case: read from the (datagram) 'groupsock':
227       readSuccess = fGS->handleRead(buffer, bufferMaxSize, bytesRead,
fromAddress);
228       } else {
         ...
242    fNextTCPReadSize -= bytesRead;
243    if (curBytesRead == 0 && curBytesToRead > 0) {
244      packetReadWasIncomplete = True;
245      return True;
246    } else if (curBytesRead < 0) {
247      bytesRead = 0;
248      readSuccess = False;
249    } else {
250      readSuccess = True;
251    }
252    fNextTCPReadStreamSocketNum = -1; // default, for next time
         ...

Pay attension to line 252, variable fNextTCPReadStreamSocketNum is reset to
-1 when handRead succeed(readSuccess=True). But at this time it is possible
for condition fNextTCPReadSize > 0. if there are still bytes in TCP, and
fNextTCPReadStreamSocketNum was reset to -1, Next time function handRead
would goto line 227, and fNextTCPReadStreamSocketNum would not be set again
in function SocketDescriptor::tcpReadHandler1, case AWAITING_SIZE2. Once it
happen, rtsp client would never receive packets via RTP over RTSP
connection.

It's very stranger why this scenarion dont' appear in example openRTSP. I
just create a new MediaSink in my program, and it happened. too bad !!! :-(

Shiyong Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120407/caa08117/attachment.html>


More information about the live-devel mailing list