[Live-devel] Possible bug (and fix)?

Звягинцев Антон zvyagintsev at atlantis.ru
Fri Sep 7 00:25:29 PDT 2012


Hello.

Don't know why but I cant post in my previous thread so I started another
one.

This is about the openrtsp/live555 problem on windows with the rtp over rtsp
tcp channel.

 

I've done some debugging and put additional debug output to live555 on
incoming data handling.

Take a look:

 

:Skipped some RTSP related output:

 

Received a complete PLAY response:

RTSP/1.0 200 OK

CSeq: 6

Session: d85

 

Started playing session

Receiving streamed data...

readSocket()=1, buffer[0]=36

readSocket()=1, buffer[0]=0

readSocket()=1, buffer[0]=5

readSocket()=1, buffer[0]=152

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

readSocket()=1432

RTPInterface::handleRead() curBytesRead=1432 bytesRead=1432
totBytesToRead=1432

RTPInterface::handleRead() fNextTCPReadSize=0

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#4 MultiFramedRTPSource::doGetNextFrame1() nextPacket != NULL

readSocket()=1, buffer[0]=36

readSocket()=1, buffer[0]=0

readSocket()=1, buffer[0]=0

readSocket()=1, buffer[0]=232

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

readSocket()=232

RTPInterface::handleRead() curBytesRead=232 bytesRead=232 totBytesToRead=232

RTPInterface::handleRead() fNextTCPReadSize=0

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#4 MultiFramedRTPSource::doGetNextFrame1() nextPacket != NULL

readSocket()=1, buffer[0]=36

readSocket()=1, buffer[0]=0

readSocket()=1, buffer[0]=5

readSocket()=1, buffer[0]=152

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

readSocket()=1432

RTPInterface::handleRead() curBytesRead=1432 bytesRead=1432
totBytesToRead=1432

RTPInterface::handleRead() fNextTCPReadSize=0

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#4 MultiFramedRTPSource::doGetNextFrame1() nextPacket != NULL

#5 MultiFramedRTPSource::doGetNextFrame1() after nextPacket->use()
frameSize=1419 fFrameSize=1419

#6 MultiFramedRTPSource::doGetNextFrame1() !fCurrentPacketCompletesFrame
fFrameSize=1419 fMaxSize=262144

 

readSocket()=1, buffer[0]=36

readSocket()=1, buffer[0]=0

readSocket()=1, buffer[0]=5

readSocket()=1, buffer[0]=152

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

readSocket()=1432

RTPInterface::handleRead() curBytesRead=1432 bytesRead=1432
totBytesToRead=1432

RTPInterface::handleRead() fNextTCPReadSize=0

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#4 MultiFramedRTPSource::doGetNextFrame1() nextPacket != NULL

#5 MultiFramedRTPSource::doGetNextFrame1() after nextPacket->use()
frameSize=1418 fFrameSize=2837

#6 MultiFramedRTPSource::doGetNextFrame1() !fCurrentPacketCompletesFrame
fFrameSize=2837 fMaxSize=260725

 

readSocket()=1, buffer[0]=36

readSocket()=1, buffer[0]=0

readSocket()=1, buffer[0]=5

readSocket()=1, buffer[0]=152

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

readSocket()=44

RTPInterface::handleRead() curBytesRead=44 bytesRead=44 totBytesToRead=1432

RTPInterface::handleRead() fNextTCPReadSize=1388

fillInData() return false

#3 MultiFramedRTPSource::doGetNextFrame1()

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

#3 MultiFramedRTPSource::doGetNextFrame1()

#1 MultiFramedRTPSource::networkReadHandler1() before fillInData()

#2 MultiFramedRTPSource::networkReadHandler1() before processing RTP header

: repeated until break:

 

Looks like after the fillInData returns false its hang in some kind of loop
and stop to receive any futher data.

Lets check the code of RTPInterdace::handleRead:

 

  } else {

    // Read from the TCP connection:

    bytesRead = 0;

    unsigned totBytesToRead = fNextTCPReadSize;

    if (totBytesToRead > bufferMaxSize) totBytesToRead = bufferMaxSize;

    unsigned curBytesToRead = totBytesToRead;

    int curBytesRead;

    while ((curBytesRead = readSocket(envir(), fNextTCPReadStreamSocketNum,

 
&buffer[bytesRead], curBytesToRead,

 
fromAddress)) > 0) {

      bytesRead += curBytesRead;

      if (bytesRead >= totBytesToRead) break;

      curBytesToRead -= curBytesRead;

    }

    fNextTCPReadSize -= bytesRead;

    if (fNextTCPReadSize == 0) {

      // We've read all of the data that we asked for

      readSuccess = True;

    } else if (curBytesRead <= 0) {

      // There was an error reading the socket

      bytesRead = 0;

      readSuccess = False;

    } else {

      // We need to read more bytes, and there was not an error reading the
socket

      packetReadWasIncomplete = True;

      return True;

    }

 

If I change 

    } else if (curBytesRead <= 0) {

to

    } else if (curBytesRead < 0) {

 

openrtsp starts to working properly and receive data from stream. Is it a
bug or I misunderstood something?

Thanks in advance.

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120907/6172d4e5/attachment-0001.html>


More information about the live-devel mailing list