[Live-devel] TEARDOWN issue when using response handler
Matt Schuckmann
matt at schuckmannacres.com
Thu Nov 8 10:45:24 PST 2012
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)->myStartStreamEvent);
>
>
> env.taskScheduler().deleteEventTrigger(((OurRTSPClient*)rtspClient)->myStopStreamEvent);
>
>
> env.taskScheduler().deleteEventTrigger(((OurRTSPClient*)rtspClient)->mySeekAbsoluteEvent);
>
> env << *rtspClient << "Closing the stream.\n";
>
> Medium::close(rtspClient);
>
> }
>
> /Claes
>
>
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel
More information about the live-devel
mailing list