tests/playback: correct state change checking

Correct the test apps check if result of state change is not failure as the
state change can happen async

https://bugzilla.gnome.org/show_bug.cgi?id=739346
This commit is contained in:
Ravi Kiran K N 2014-10-29 16:26:07 +05:30 committed by Luis de Bethencourt
parent 691f020c57
commit d86aba27ce
2 changed files with 6 additions and 6 deletions

View file

@ -32,7 +32,7 @@ main (gint argc, gchar * argv[])
g_object_set (G_OBJECT (player), "uri", argv[1], NULL);
res = gst_element_set_state (player, GST_STATE_PLAYING);
if (res != GST_STATE_CHANGE_SUCCESS) {
if (res == GST_STATE_CHANGE_FAILURE) {
g_print ("could not play\n");
return -1;
}

View file

@ -48,7 +48,7 @@ main (gint argc, gchar * argv[])
g_print ("play...\n");
res = gst_element_set_state (player, GST_STATE_PLAYING);
if (res != GST_STATE_CHANGE_SUCCESS) {
if (res == GST_STATE_CHANGE_FAILURE) {
g_print ("could not play\n");
return -1;
}
@ -58,8 +58,8 @@ main (gint argc, gchar * argv[])
g_print ("pause...\n");
res = gst_element_set_state (player, GST_STATE_PAUSED);
if (res != GST_STATE_CHANGE_SUCCESS) {
g_print ("could not play\n");
if (res == GST_STATE_CHANGE_FAILURE) {
g_print ("could not pause\n");
return -1;
}
@ -68,7 +68,7 @@ main (gint argc, gchar * argv[])
g_print ("play...\n");
res = gst_element_set_state (player, GST_STATE_PLAYING);
if (res != GST_STATE_CHANGE_SUCCESS) {
if (res == GST_STATE_CHANGE_FAILURE) {
g_print ("could not play\n");
return -1;
}
@ -88,7 +88,7 @@ main (gint argc, gchar * argv[])
g_print ("play...\n");
res = gst_element_set_state (player, GST_STATE_PLAYING);
if (res != GST_STATE_CHANGE_SUCCESS) {
if (res == GST_STATE_CHANGE_FAILURE) {
g_print ("could not play\n");
return -1;
}