sendrecv: Don't set pipeline state if it's NULL

Avoids ugly CRITICAL warnings when erroring out.
This commit is contained in:
Nirbheek Chauhan 2018-03-31 10:28:51 +05:30
parent 82314cabbb
commit 563826deaf

View file

@ -647,11 +647,13 @@ main (int argc, char *argv[])
connect_to_websocket_server_async ();
g_main_loop_run (loop);
g_main_loop_unref (loop);
gst_element_set_state (GST_ELEMENT (pipe1), GST_STATE_NULL);
g_print ("Pipeline stopped\n");
gst_object_unref (pipe1);
if (pipe1) {
gst_element_set_state (GST_ELEMENT (pipe1), GST_STATE_NULL);
g_print ("Pipeline stopped\n");
gst_object_unref (pipe1);
}
return 0;
}