<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><div><blockquote type="cite"><blockquote type="cite">2. Also I have seen possible ServerMediaSession object relations bug<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">in RTSPServer::addServerMediaSession/RTSPServer::removeServerMediaSession<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">methods.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Method addServerMediaSession adds a ServerMediaSession object to<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">hashmap fServerMediaSessions and call removeServerMediaSession on<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">ServerMediaSession object previously set in the hashmap (if both<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">objects have same stream name). Method removeServerMediaSession<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">removes from the hashmap new ServerMediaSession object just added by<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">addServerMediaSession.<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Yes, this is a bug. It will get fixed in a future release.<br></blockquote><br>I'm sorry, but I fail to see how this was a bug. Seems to me that RTSPServer::addServerMediaSession was removing an existing ServerMediaSession with the same name as the one being created, if any. <br></div></blockquote><div><br></div><div>No, the old code was doing (when implementing "RTSPServer::addServerMediaSession()"):</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ServerMediaSession* existingSession</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>= (ServerMediaSession*)(fServerMediaSessions->Add(sessionName, (void*)serverMediaSession));</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>removeServerMediaSession(existingSession); // if any</div><div><br></div><div>which was a bug, because - if "existingSession" was not NULL, then the call to</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>removeServerMediaSession(existingSession); // if any</div><div><br></div><div>happened to remove - from the hash table - the *new* "serverMediaSession" that had just been added - because of the way that</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> RTSPServer::removeServerMediaSession(ServerMediaSession* </span>existingSession<span class="Apple-tab-span" style="white-space:pre">)</span></div><div><br></div><div>is implemented by calling</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> Remove(</span>existingSession<span class="Apple-tab-span" style="white-space:pre">->streamName());</span></div><div><br></div><div>on the internal hash table.</div><div><br></div><div><br></div><div>The new code does:</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>removeServerMediaSession(sessionName); // in case an existing "ServerMediaSession" with this name already exists</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fServerMediaSessions->Add(sessionName, (void*)serverMediaSession);</div></div><div><br></div><div>which is correct, except for the fact that</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>void RTSPServer::removeServerMediaSession(char const* sessionName)</div><div><br></div><div>is implemented by calling</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>removeServerMediaSession(lookupServerMediaSession(sessionName));</div><div><br></div></div><div>i.e., by calling the "lookupServerMediaSession()" *virtual function*. That's a bug. The code should just be doing a hash table lookup here; not calling the "lookupServerMediaSession()" virtual function.</div><div><br></div><div>I've now installed a new version (2012.05.17) of the code that fixes this.</div><div><br></div></div></div><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>