--- Begin Message ---
Below is the high-level implementation for creating and deleting proxies in an 
RTSP server.
The addProxy and removeProxy methods are invoked multiple times in a random 
order by the application.

int RtspServer::addProxy(const string& streamName)
{
    std::lock_guard<std::mutex> lock(m_proxyLock);

    // Check whether we already have a "ServerMediaSession" for this stream, 
Remove it.
    m_rtspServer->lookupServerMediaSession(streamName.c_str(), ...)
    m_sms = ProxyServerMediaSession::createNew(streamName, ..);
    m_rtspServer->addServerMediaSession(m_sms);

    proxyStreamURL = m_rtspServer->rtspURL(m_sms);
}


int RtspServer::removeProxy(const string& streamName)
{
    std::lock_guard<std::mutex> lock(m_proxyLock);

    // Find " ServerMediaSession " & delete it
    GenericMediaServer::ServerMediaSessionIterator *iter =
            new GenericMediaServer::ServerMediaSessionIterator(*this);
    ServerMediaSession *sms = NULL;
    while((sms = (ServerMediaSession *)iter->next()) != NULL)  {
        if (sms)  {
            if(strcmp(sms->streamName(), streamName) == 0)  {
                m_rtspServer ->deleteServerMediaSession(sms);
            }
        }
    }
    delete iter;
}

Thanks & Regards,
Gous Mulla
Senior Software Engineer, Nvidia
http://www.nvidia.com/

-----Original Message-----
From: live-devel <live-devel-boun...@us.live555.com> On Behalf Of Ross Finlayson
Sent: Tuesday, August 13, 2024 10:45 AM
To: LIVE555 Streaming Media - development & use <live-de...@us.live555.com>
Subject: Re: [Live-devel] Live555 Proxy add/remove frequently

External email: Use caution opening links or attachments


> On Aug 12, 2024, at 9:55 PM, Gous Mulla via live-devel 
> <live-de...@us.live555.com> wrote:
>
>  We’ve confirmed that the same crash occurs in the latest live version, 
> 2024.08.01.

OK, it looks like there is a bug in the LIVE555 code that is causing this, 
because it should be OK for a (proxy) server to delete - using 
“deleteServerMediaSession()” - a “ServerMediaSession” that it had previously 
created by calling "ProxyServerMediaSession::createNew().  But it might be hard 
for me to reproduce this, because you have modified the supplied source code.

Can you say some more about how you are creating/deleting “ServerMediaSession”s 
(in situations where this crash occurs)?  Do you ever see the crash when you 
create (and later delete) only a single “ServerMediaSession”?  Or are you only 
seeing it when you create (and later delete) multiple “ServerMediaSession”s 
within your server?


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel


--- End Message ---
_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to