[Live-devel] OnDemandServerMediaSubsession bug

Scott Hays sdhays.neon.com.tw at gmail.com
Tue Jul 4 04:04:22 PDT 2006


On 7/4/06, Ross Finlayson <finlayson at live555.com> wrote:
>
>
> I don't see how this can happen, because
> "OnDemandServerMediaSubsession::deleteStream() " is the only place
> where the reference count is *decremented*.  I assume, therefore,
> that you are instead referring to the reference count being *set*
> (not decremented) to 0 in "StreamState::reclaim()" (which is called
> by "afterPlayingStreamState()")?


That's right.  deleteStream is getting called while
streamState->referenceCount() is already 0, so it doesn't enter the if
statement that deletes streamState and sets streamToken to NULL.  This
causes fLastStreamToken to not get set to NULL, so the next time
getStreamParameters() gets called, it takes the "else" path instead of
taking the "first source" path.


I *think* this will work, although I'm a bit worried about the
> "StreamState" object getting deleted twice (once when the reference
> count was 1, and again when the reference count was 0).  However,
> because the "streamToken" reference parameter will get set to NULL
> the first time the object gets deleted, I don't think that situation
> will occur.


The count seems to be set to 0 in StreamState::afterPlayingStreamState()
(which calls streamState->reclaim()) first, then deleteStream() is called.
So it seems to still only be getting deleted once: in deleteStream().


So, I'll go ahead and make this change in the next release of the
> software.  In the meantime, please let me know if it causes any
> problems for you.


Thanks,
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20060704/18c0b2b7/attachment.html 


More information about the live-devel mailing list