Correct Error handling with filesrc "Resource not found" and demux
Tim Müller
tim at centricular.com
Tue Nov 19 02:52:08 PST 2013
On Tue, 2013-11-19 at 01:36 -0800, adrien_sch wrote:
Hi Adrien,
> Simple question to clarify one case : How to correctly handle a "Resource
> not found" error on a pipeline like this : filesrc ! matroskademux
>
> My first answer was that I have to send a EOS event in filesrc, and it may
> be forwarded in the bus, but I didn't see it.
>
> Second answer, was that I may quit directly the loop and downgrade my state
> to NULL. It didn't work beacause after a while I got an error : Too many
> open files (predictable but I tried).
>
> Third answer : It will be to add a probe between the filesrc and the demux
> element to catch the EOS event and then quit the main loop. The problem is
> that the EOS event will not be processed by the demux element and it's sound
> a bit dirty. Note : the demux sink pad aren't created because any data has
> been forward to it.
When you receive the error message in your application's bus watch
message handler you could just do:
gst_element_set_state (pipeline, GST_STATE_NULL);
g_main_loop_quit (loop);
return FALSE;
This should close the file, and shut down the pipeline. You can then
free the pipeline with gst_object_unref(pipeline), unless you want to
try with another file.
If you have too many open file descriptors, first check what kind of
file descriptors those are. It might indicate that you're leaking the
GstBus or pipeline or the bus watch doesn't get removed properly (if
you're setting up a new pipeline).
Cheers
-Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com
More information about the gstreamer-devel
mailing list