Commit 39b79b12 authored by Nils Hasler's avatar Nils Hasler

change state of pipeline to NULL before freeing.

parent 43f12fa9
......@@ -347,12 +347,12 @@ bool CvCapture_GStreamer::open( int type, const char* filename )
if(!uridecodebin) {
uridecodebin = gst_element_factory_make ("uridecodebin", NULL);
g_object_set(G_OBJECT(uridecodebin),"uri",uri, NULL);
}
if(!uridecodebin) {
CV_WARN("GStreamer: Failed to create uridecodebin\n");
close();
return false;
}
}
if(manualpipeline) {
GstIterator *it = gst_bin_iterate_sinks(GST_BIN(uridecodebin));
......@@ -401,6 +401,7 @@ bool CvCapture_GStreamer::open( int type, const char* filename )
if(gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING) ==
GST_STATE_CHANGE_FAILURE) {
gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_NULL);
CV_WARN("GStreamer: unable to set pipeline to playing\n");
gst_object_unref(pipeline);
return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment