read-metadata: Stop if setting the pipeline state back to NULL fails

This commit is contained in:
Sebastian Dröge 2010-06-13 17:03:53 +02:00
parent 59147fd111
commit 199b180439

View file

@ -184,7 +184,12 @@ main (int argc, char *argv[])
g_print ("No metadata found for %s\n", argv[i]);
sret = gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL);
#ifndef NEW_PIPE_PER_FILE
#ifdef NEW_PIPE_PER_FILE
if (sret != GST_STATE_CHANGE_SUCCESS) {
g_print ("State change failed. Aborting\n");
break;
}
#else
if (GST_STATE_CHANGE_ASYNC == sret) {
if (GST_STATE_CHANGE_FAILURE ==
gst_element_get_state (GST_ELEMENT (pipeline), &state, NULL,
@ -192,6 +197,9 @@ main (int argc, char *argv[])
g_print ("State change failed. Aborting");
break;
}
} else if (sret != GST_STATE_CHANGE_SUCCESS) {
g_print ("State change failed. Aborting\n");
break;
}
#endif