[Live-devel] TEARDOWN issue when using response handler

Erlandsson, Claes P (CERLANDS) CERLANDS at arinc.com
Thu Nov 8 11:30:49 PST 2012


Yes, I only call shutdownStream() from my StopStreamEvent, which is
triggered by triggerEvent(), and from other "internal" functions, similar to
the testRTSPClient example.

If that was the case though, I imagine it would be more random, and also
happen when not using a response handler. A few months back I did the
mistake of not using triggerEvent() and I sure experiences random crashes,
but this looks different.

/Claes


-----Original Message-----
From: live-devel-bounces at ns.live555.com
[mailto:live-devel-bounces at ns.live555.com] On Behalf Of Matt Schuckmann
Sent: Thursday, November 08, 2012 12:45 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] TEARDOWN issue when using response handler

Are you sure you're calling sendTeardownCommand() from the liveMedia 
thread?
Typically I've seen random crashes like this when calling a liveMedia 
method from the wrong thread, usually inadvertently.

Matt S.

On Thursday, November 08, 2012 10:26:16 AM, Erlandsson, Claes P 
(CERLANDS) wrote:
> I'm using the liveMedia (2012.11.05) connecting to a Cisco VSM
> (version 6.3.2-47d). The server, as I've mentioned in a previous post,
> requires the client to wait for the TEARDOWN-response, otherwise the
> server logs will be filled with errors and things will eventually go
> bad. This can arguably be considered an issue with the server, but it
> should anyhow be possible to work around.
>
> The issue on the client side is that whenever using a TEARDOWN
> response handler it crashes once in a while. I want to point out that
> I've has the issue when using sendTeardownCommand() without a response
> handler. Our client cycles through streams frequently and I'd say I
> see the problem about 1 time out of 7000. That means about once every
> other hour when cycling through 10 cameras every 10s.
>
> After sending TEARDOWN the response handler is never called, but
> instead an exception is thrown. I haven't been able to catch the
> exception in the liveMedia DLL, but I instead get an
> AccessViolationException in the C# code that uses it. Logging shows
> that the exception happens at the exact same place every time, which
> is right after calling sendTeardownCommand(), but it never reaches the
> response handler.
>
> Please see sample code below.
>
> The code can't really be simpler, and I've no idea why it occurs.
>
> Have I missed something obvious? Anyone experienced anything similar?
>
> voidshutdownStream(RTSPClient* rtspClient, int exitCode)
>
> {
>
> // Code omitted, as shutdownStream() is identical to the
> testRTSPClient example
>
> // beside having moved Medium::close(rtspClient) to a separate
> function and adding
>
> // the TEARDOWN response handler
>
> ...
>
> if(someSubsessionsWereActive)
>
> rtspClient->sendTeardownCommand(*scs.session, continueAfterTEARDOWN);
>
> else
>
>                 cleanUpStream(rtspClient);
>
>      }
>
> else
>
>      {
>
>            cleanUpStream(rtspClient);
>
>      }
>
> }
>
> voidcontinueAfterTEARDOWN(RTSPClient* rtspClient, int resultCode,
> char* resultString)
>
> {
>
>      cleanUpStream(rtspClient);
>
> }
>
> voidcleanUpStream(RTSPClient* rtspClient)
>
> {
>
>      UsageEnvironment& env = rtspClient->envir();
>
>
>
env.taskScheduler().deleteEventTrigger(((OurRTSPClient*)rtspClient)->myStart
StreamEvent);
>
>
>
env.taskScheduler().deleteEventTrigger(((OurRTSPClient*)rtspClient)->myStopS
treamEvent);
>
>
>
env.taskScheduler().deleteEventTrigger(((OurRTSPClient*)rtspClient)->mySeekA
bsoluteEvent);
>
>      env << *rtspClient << "Closing the stream.\n";
>
>      Medium::close(rtspClient);
>
> }
>
> /Claes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5740 bytes
Desc: not available
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20121108/e406a9d8/attachment.bin>


More information about the live-devel mailing list