On 7/4/06, <b class="gmail_sendername">Ross Finlayson</b> <<a href="mailto:finlayson@live555.com">finlayson@live555.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>I don't see how this can happen, because<br>"OnDemandServerMediaSubsession::deleteStream() " is the only place<br>where the reference count is *decremented*. I assume, therefore,<br>that you are instead referring to the reference count being *set*
<br>(not decremented) to 0 in "StreamState::reclaim()" (which is called<br>by "afterPlayingStreamState()")?</blockquote><div><br>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.
<br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I *think* this will work, although I'm a bit worried about the<br>"StreamState" object getting deleted twice (once when the reference
<br>count was 1, and again when the reference count was 0). However,<br>because the "streamToken" reference parameter will get set to NULL<br>the first time the object gets deleted, I don't think that situation
<br>will occur.</blockquote><div><br>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().
<br> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">So, I'll go ahead and make this change in the next release of the<br>software. In the meantime, please let me know if it causes any
<br>problems for you.</blockquote><div><br>Thanks,<br>Scott<br></div></div><br>