<div dir="ltr">You are right, for closing stream source the way you mentioned is simpler than my way.<div>But for other purposes, I would handle the job in the same class.</div><div> <br><div><span style="color:rgb(80,0,80)">Thanks again.</span></div><div><span style="color:rgb(80,0,80)">Regards.</span></div></div><div><span style="color:rgb(80,0,80)"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 27, 2019 at 1:13 AM Ross Finlayson <<a href="mailto:finlayson@live555.com">finlayson@live555.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
> On Dec 27, 2019, at 2:08 AM, Steve Ha <<a href="mailto:steveha@u2sr.com" target="_blank">steveha@u2sr.com</a>> wrote:<br>
> <br>
> After seeing no issue in the testOnDemandRtspServer, I check my program again and <br>
> I found the cause.<br>
<br>
I’m glad to hear this!<br>
<br>
<br>
> Previously I handled streaming ON/OFF in the function <br>
> DerivedOnDemandxxx::deleteStream(clientSessionId, streamToken) {}<br>
> Now I realized that doing so is reasonable only when reuseFirstSource = False.<br>
> When  reuseFirstSource = True, the right place to control stream is at function <br>
> DerivedOnDemandxxx ::closeStreamSource(FramedSource* inputSource) {}<br>
<br>
Actually, an even simpler solution would be to turn off streaming only in your “FramedSource” subclass’s destructor.  Then you wouldn’t need to redefine “closeStreamSource()” (or “deleteStream()”) at all.<br>
<br>
(See, for example, “liveMedia/DeviceSource.cpp”)<br>
<br>
<br>
Ross Finlayson<br>
Live Networks, Inc.<br>
<a href="http://www.live555.com/" rel="noreferrer" target="_blank">http://www.live555.com/</a><br>
<br>
<br>
_______________________________________________<br>
live-devel mailing list<br>
<a href="mailto:live-devel@lists.live555.com" target="_blank">live-devel@lists.live555.com</a><br>
<a href="http://lists.live555.com/mailman/listinfo/live-devel" rel="noreferrer" target="_blank">http://lists.live555.com/mailman/listinfo/live-devel</a><br>
</blockquote></div>