[Live-devel] Multiple File Sinks Issue

Ross Finlayson finlayson at live555.com
Mon Feb 25 16:49:32 PST 2019


> while(true) {
>   TS_Sink = FileSink::createNew(*env, uniqueFileName);
>   TS_Sink->startPlaying(*streamTS, NULL, NULL);
>   sleep(2) // Continuous output of files with 2 seconds of video each
>   TS_Sink->stopPlaying()
>   Medium::close(TS_Sink)
> }

You MUST NOT call “sleep()” within a LIVE555 application, because LIVE555 applications run in a (single-threaded) event loop.  Calling “sleep()” will stop all other activity from happening during that time.

Instead, have the calls to “stopPlaying()” and “Medium::close()” happen within a function, and have that function scheduled (to take place after 2 seconds) using the “scheduleDelayedTask()” function.  (You’ll see several examples of this in the “testProgs” directory.)


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




More information about the live-devel mailing list