[Live-devel] Multiple livemedia libs in the same process

Ross Finlayson finlayson at live555.com
Tue Feb 17 13:25:02 PST 2009


>I have the following problem. I have a basic application that uses 
>livemedia (server to stream to clients). The application links to a 
>static livemedia library. This main application also uses a second 
>external library. This library also uses livemedia dynamically 
>(client to connect to a server). The problem is: the doEventLoop() 
>in the external library fails immediately. If we removed the static 
>linked livemedia library from the main application the external 
>library works fine.
>
>There seems to be a shared resource in use, even though we use 2 
>different libraries and 2 different threads. Ports are different so 
>I'm not sure which other resource is causing this.
>
>Anyone an idea?

Well, I'm not convinced that you can have more than one instance of 
*any* library linked into a process - static or dynamic - and expect 
things to work properly.  Why not just use a single instance of the 
library (i.e., the static one)?

You can use more than one thread within a process that uses our 
library only if either (i) only one thread uses the library, or (ii) 
if more than one thread uses the library, each does so using a 
completely different "UsageEnvironment" object, and do not access 
each others' objects.  See the FAQ!

Your best bet, though, is to use separate processes, not multiple 
threads within the same process.
-- 

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


More information about the live-devel mailing list