adder: sync some fixes from the audiomixer test

This commit is contained in:
Stefan Sauer 2017-07-10 21:07:14 +02:00
parent 12c69c4cdf
commit 8133f478a9

View file

@ -117,6 +117,7 @@ play_and_wait (GstElement * pipeline)
state_res = gst_element_set_state (pipeline, GST_STATE_PLAYING); state_res = gst_element_set_state (pipeline, GST_STATE_PLAYING);
ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE); ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
GST_INFO ("running main loop");
g_main_loop_run (main_loop); g_main_loop_run (main_loop);
state_res = gst_element_set_state (pipeline, GST_STATE_NULL); state_res = gst_element_set_state (pipeline, GST_STATE_NULL);
@ -244,7 +245,6 @@ GST_START_TEST (test_event)
GstElement *bin, *src1, *src2, *adder, *sink; GstElement *bin, *src1, *src2, *adder, *sink;
GstBus *bus; GstBus *bus;
GstEvent *seek_event; GstEvent *seek_event;
GstStateChangeReturn state_res;
gboolean res; gboolean res;
GstPad *srcpad, *sinkpad; GstPad *srcpad, *sinkpad;
GstStreamConsistency *chk_1, *chk_2, *chk_3; GstStreamConsistency *chk_1, *chk_2, *chk_3;
@ -313,14 +313,7 @@ GST_START_TEST (test_event)
fail_unless (res == TRUE, NULL); fail_unless (res == TRUE, NULL);
/* run pipeline */ /* run pipeline */
state_res = gst_element_set_state (bin, GST_STATE_PLAYING); play_and_wait (bin);
ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
GST_INFO ("running main loop");
g_main_loop_run (main_loop);
state_res = gst_element_set_state (bin, GST_STATE_NULL);
ck_assert_int_ne (state_res, GST_STATE_CHANGE_FAILURE);
ck_assert_int_eq (position, 2 * GST_SECOND); ck_assert_int_eq (position, 2 * GST_SECOND);
@ -550,6 +543,9 @@ GST_START_TEST (test_live_seeking)
"pulseaudiosrc" "pulseaudiosrc"
}; };
GST_INFO ("preparing test");
play_seek_event = NULL;
/* build pipeline */ /* build pipeline */
bin = gst_pipeline_new ("pipeline"); bin = gst_pipeline_new ("pipeline");
bus = gst_element_get_bus (bin); bus = gst_element_get_bus (bin);
@ -621,7 +617,8 @@ GST_START_TEST (test_live_seeking)
/* cleanup */ /* cleanup */
GST_INFO ("cleaning up"); GST_INFO ("cleaning up");
gst_consistency_checker_free (consist); gst_consistency_checker_free (consist);
gst_event_unref (play_seek_event); if (play_seek_event)
gst_event_unref (play_seek_event);
gst_bus_remove_signal_watch (bus); gst_bus_remove_signal_watch (bus);
gst_object_unref (bus); gst_object_unref (bus);
gst_object_unref (bin); gst_object_unref (bin);