> On Thu, 10 Jan 2013 11:00:43 -0800, Ross Finlayson wrote
>> Instead, try making the following change to 
>> "FileSink::afterGettingFrame()" (lines 130-132 of 
>> "liveMedia/FileSink.cpp"): Change the order of the calls to    
>> onSourceClosure(this); and    stopPlaying(); so that "stopPlaying()" 
>> is called first, before "onSourceClosure(this)".
>> 
>> Let us know if this works for you.  (If so, I'll make the change in 
>> the next release of the software.)
> 
> 1.
> Yes and no. It did work on the testReplicator app

OK, so I'll make that change (changing the order of the calls to 
"onSourceClosure(this);" and "stopPlaying();" in 
"FileSink::afterGettingFrame()") in the next release of the software.


> The main difference - regarding this issue - between our server and the
> testReplicator app is that, after an error occurs trying to write a video 
> file,
> we schedule the writing to start again at a later time. We do that by 
> overriding
> the MediaSink::stopPlaying method in our own FileSink class:
> 
> virtual void stopPlaying() {
>  MediaSink::stopPlaying();
> 
>  // schedule to restart in 10 secs
>  envir() << "OurFileSink stopped! Scheduling to restart in 10 secs.\n";
>  envir().taskScheduler().scheduleDelayedTask(10000000,
>      (TaskFunc *) OurFileSink::startPlaying, this);
> }

No - that's a bad idea.  You shouldn't be redefining a virtual function to do 
something completely unrelated to what the rest of the code - that calls this 
virtual function - expects.  (That's why you keep running into trouble :-)

The right place to be scheduling a new 'playing' task is in your 'after 
playing' function - i.e., the function that you passed as a parameter when you 
called "startPlaying()" on your "FileSink" subclass.  That 'after playing' 
function will get called, automatically, when writes to the file fail (or if 
the input stream closes) - as a result of the call to "onSourceClosure(this);". 
 So that's where you should be scheduling your new task.


> I'm attaching the StreamReplicator class with our patches

I didn't see any attachment!


> 2.
> Also, we needed to change the visibility of the FileSink::continuePlaying()
> method to protected

OK, I'll make that change (along with the change to the implementation of 
"FileSink::afterGettingFrame()" - noted earlier) in the next release of the 
software.

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

_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to