[Live-devel] Problem in sending PAUSE and then PLAY request in openrtsp
Ross Finlayson
finlayson at live555.com
Tue Jul 24 10:54:03 PDT 2007
>On Tue, 2007-07-24 at 05:19 -0500, Ross Finlayson wrote:
>> > We are using openRTSP Client to receive mpeg2 streams. When we call
>> > PAUSE and then PLAY request during streaming then
>> > we observed functiongetResponse1() is getting called from two
>> > places simultaneously
>>
> >
>> No. Remember that the code is single-threaded. It is not possible for
>> "getResponse1()" - or any other function - to be called from two
>> places 'simultaneously'.
>>
>I found the same things. live.2007.04.24a
>
>in file RTSPClient.cpp: function
>
>Boolean RTSPClient::playMediaSession(MediaSession& session,
> float start, float end, float
>scale) {
>................
>line 1096
> if (fTCPStreamIdCount == 0) { // we're not receiving RTP-over-TCP
> // Arrange to handle incoming requests sent by the server
>
>envir().taskScheduler().turnOnBackgroundReadHandling(fInputSocketNum,
>
>(TaskScheduler::BackgroundHandlerProc*)&incomingRequestHandler, this);
> }
>
>If you comment out this code block, than you can always resume from
> pause. Otherwise this is like a russian roulette :-).
>
>getResponse -> getResponse1 -> (pause/resume okey)
>OR
>incomingRequestHandler -> incomingRequestHandler1 -> getResponse1 ->
>you are blocked in select
From what I can tell, the second case should not be happening,
because the "pauseMediaS(ubs)ession()" function does synchronous
I/O, and does not enter the event loop. ("incomingRequestHandler()"
is called only from within the event loop.) I.e., if you call
"pauseMediaS(ubs)ession()", you'll sent the "PAUSE" command, and then
wait for and read the subsequent response - without any problem.
(Nonetheless, as I noted earlier, this currently works only for
RTP-over-UDP streaming, not RTP-over-TCP.)
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list