[Live-devel] Open RTSP and video file splitting...
Ross Finlayson
finlayson at live555.com
Thu Dec 16 09:36:12 PST 2010
>But often the program exits in "Segmentation Fault", and I don't know why...
The reason is that you are closing (and deleting) your 'data sink'
object - "qtOut" - but you are still 'playing' that object. I.e.,
the code thinks that it should still be receiving incoming network
data into the original "qtOut" object.
The right way to fix this - with minimal disruption to the existing
code - is not to make any changes to the network reading/recording
mechanism, but instead to use a different 'data sink' class - one
that knows how to periodically close/reopen its output file, but
without having to delete/recreate the 'data sink' object itself.
So, I suggest that you subclass the "QuickTimeFileSink" class to do this.
Unfortunately, to do this, you're going to have to make some
modifications to "liveMedia/include/QuickTimeFileSink.hh" - to change
some fields and member functions from "private:" to "protected:" - so
you can subclass "QuickTimeFileSink". (In particular, you will
definitely need to change the constructor and destructor, and
"completeOutputFile()" and "fOutFid" to "protected:") Once you've
done this, please let us know which fields/functions you needed to
make "protected:", and I'll change the next released version of the
code to make at least those fields/functions "protected:". That way,
you won't need to keep changing the released code each time.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list