[Live-devel] fNumFramesUsedSoFar and MutiFramedRTPSink

David.Bertrand at alcatel.be David.Bertrand at alcatel.be
Tue May 9 10:56:53 PDT 2006


Ross,
Here is the sequence as I understand it :
 sendNext() -> 
buildAndSendPacket()->fNumUsedFramesSoFar=0->packFrame()->getNextFrame(...,afterGettingFrame,...ourHandleClosure..) 
-> 
afterGettingFrame()->fNumUsedFramesSoFar++->sendPacketIfNecessary()->sendPacket()->++fSeqNo 
->taskScheduler().scheduleDelayedTask(...sendNext...)-> ....  
_source.handleClosure()_->ourHandleClosure()->sendPacketIfNecessary()_->sendPacket()->++fSeqNo

_Im not sure if this is clear but to say it another way : if our input 
source closes between a nextSend event that led to a frame sending 
(afterGettingFrame OK) and a nextSend event scheduled but that could not 
reset fNumUsedFramedSofar yet, we have a problem.
David
Ross Finlayson wrote:

>At 08:04 AM 5/9/2006, you wrote:
>  
>
>>I noticed a problem with variable fNumFramesUsedSoFar when 
>>MultiFramedRTPSink::ourHandleClosure() is called. In this case, 
>>sendPacketIfNecessary() is called in case we have a partially built 
>>packet to send. But variable fNumFramesUsedSoFar is only reset in 
>>buildAndSendPacket function which in this case won't be done. IMO, 
>>this reset should (also?) be done after really sending the packet, 
>>i.e at the end of function sendPacketifNecessary, for example just 
>>after incrementing SEQN. Otherwise, some "empty" packet may be sent 
>>and SEQN will wrongly be incremented.
>>Ross, do you agree with my analysis ?
>>    
>>
>
>Not really, because I think there would be a problem (with the 
>current code) only if "ourHandleClosure()" were to get called twice 
>in succession, which should never happen.  "ourHandleClosure()" gets 
>called only as a result of the "getNextFrame()" call in 
>"packFrame()", which in turn gets called only (eventually) as a 
>result of a call to "buildAndSendPacket()", which is where 
>"fNumFramesUsedSoFar" is reset to zero.  So, "ourHandleClosure" 
>should never get called when "fNumFramesUsedSoFar" has an incorrect value.
>
>
>	Ross Finlayson
>	Live Networks, Inc. (LIVE555.COM)
>	<http://www.live555.com/>
>
>_______________________________________________
>live-devel mailing list
>live-devel at lists.live555.com
>http://lists.live555.com/mailman/listinfo/live-devel
>  
>


-- 
David BERTRAND
Service Development
Alcatel Bell N.V.
Mobile Solutions Division - Video Applications
Boulevard Comte de Smet de Nayer, 14
5000 Namur - Belgium
Phone :  (32) 81 23 52 72
Mobile:  (32) 494 30 63 70
Fax :    (32) 81 23 52 99
mailto:david.bertrand at alcatel.be





More information about the live-devel mailing list