[Live-devel] StreamReplicator with FileSink problem

Ross Finlayson finlayson at live555.com
Tue Jan 22 13:51:29 PST 2013


>> 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.
> 
> Initially we were scheduling in afterPlaying function, but your suggestion of
> reordering sets fAfterFunc to NULL in MediaSink::stopPlaying() before it gets
> called in MediaSink::onSourceClosure().
> We think the correct behavior would be to call stopGettingFrames on fSource

Yes, I agree.  In the next version of the software, this piece of code - in "FileSink::afterGettingFrame()" - will become:

  if (fOutFid == NULL || fflush(fOutFid) == EOF) {
    // The output file has closed.  Handle this the same way as if the input source had closed:
    if (fSource != NULL) fSource->stopGettingFrames();
    onSourceClosure(this);
    return;
  }


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130122/441bc219/attachment.html>


More information about the live-devel mailing list