[gst-devel] gstoggmux EOS handling issue

Daniel Drake dsd at laptop.org
Mon Aug 11 17:27:08 CEST 2008


On Fri, 2008-08-08 at 14:11 +0100, Tim-Philipp Müller wrote:
> (Btw, not sure what exactly you were trying to fix, and I only had a
> very quick look at your code, but at first glance the shutdown sequence
> doesn't seem ideal: as far as I can see it won't shut down cleanly with
> an EOS making it through the recording bin; for ogg this just means that
> in the worst case you're losing a few frames at the end; with other
> muxers you might get slightly broken and/or indexless files).

Tim explained this on IRC. Cleanly shutting down the recording stream
works around the bug I found (if it is indeed a bug).

In case it helps others, the process for cleanly stopping a live capture
is as follows:
 - send an EOS on the live capture element(s) using
   gst_element_send_event(gst_event_new_eos())
 - connect a watch handler to the bus of the pipeline and wait for
   GST_MESSAGE_EOS
 - when EOS arrives, set the pipeline state to NULL

Working code here:
http://dev.laptop.org/~dsd/20080811/recordtwice.txt

Daniel






More information about the gstreamer-devel mailing list