<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><blockquote type="cite">Am I missing a step in the remove code ?<br></blockquote><div><br></div>Yes.  What you're missing is that a "PassiveServerMediaSubsession" object refers to a stream that exists independently (as opposed to an "OnDemandServerMediaSubsession", that creates (and destroys) its own stream, on demand).  Therefore, for the multicast case, you need to not only create the stream separately, you also need to destroy it separately.  In particular, to destroy it, you should delete objects in this order:</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>Medium::close(rtcp);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Medium::close(sink);</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Medium::close(videoSource); // note that this will also automatically delete the "vidSrc"("MPEG2TransportStreamFromESSource") and "source" objects</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>delete rtcpGroupsock;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>delete rtpGroupsock;</div><div><br></div><div><blockquote type="cite"></blockquote>Also:</div><div><br><blockquote type="cite">To remove<br>rtspServer->deleteServerMediaSession(stream->sms);<br>stream->sms->deleteAllSubsessions();<br></blockquote><div><br></div>The second statement is unnecessary.  Even worse, it can cause a crash, because the first statement deletes the "stream->sms" object!</div><div><br></div><div><br><blockquote type="cite">(For Multicast)<br>const Port rtpPort(stream->rtpPort);<br>Groupsock *rtpGroupsock = new Groupsock(*env, destaddr, rtpPort, stream->ttl);<br>rtpGroupsock->multicastSendOnly();<br>const Port rtcpPort(stream->rtcpPort);<br>Groupsock *rtcpGroupsock = new Groupsock(*env, destaddr, rtcpPort, stream->ttl);<br>rtcpGroupsock->multicastSendOnly();<br>RTPSink *sink = SimpleRTPSink::createNew(*env, rtpGroupsock, 33, 90000, "video", "MP2T", 1, True, False /*no 'M' bit*/);<br>RTCPInstance *rtcp = RTCPInstance::createNew(*env, rtcpGroupsock, estimatedSessionBandwidth, CNAME, sink, NULL, True);<br>stream->sms->addSubsession(PassiveServerMediaSubsession::createNew(*sink, rtcp));<br>MPEG2TransportStreamFromESSource *vidSrc = MPEG2TransportStreamFromESSource::createNew(*env);<br>vidSrc->addNewVideoSource(source, 2);<br>MPEG2TransportStreamFramer *videoSource = MPEG2TransportStreamFramer::createNew(*env, vidSrc);<br></blockquote><div><br></div>Of course, there's also a call to sink<-startPlaying(*videoSource, ...);</div><br><br><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;  "><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;  ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>