[Live-devel] shared audio stream

Ross Finlayson finlayson at live555.com
Wed Oct 23 11:41:05 PDT 2024



> On Oct 23, 2024, at 8:37 PM, Lutz Fiebach <lutz at fiebach.de> wrote:
> 
> Hi,
> yes, have use this option “reuseFirstSource”.
> The problem is, we have 2 ServerMediaSession's with the same audio stream.
> 1. high resolution + audio
> 2. low resolution + audio

OK, so that’s your problem - because a “FramedSource” is not meant to be read by more than one downstream object at the same time.  (In fact, the code is supposed to trigger an internal error (and exit()) whenever this happens; I don’t know why you’re not seeing that.)

Your solution is to use the “StreamReplicator” class to create a separate “FramedSource” object from the original audio stream, and use that in your second “ServerMediaSubsession” - i.e.

If “audioSource” is your original audio “FramedSource”, then do:
	StreamReplicator* replicator = StreamReplicator::createNew(*env, audioSource);
	FramedSource* audioSource2 = replicator->createStreamReplica();
Then use “audioSource” in your first “ServerMediaSubsession”, and use “audioSource2” in your second “ServerMediaSubsession”.


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




More information about the live-devel mailing list