tests: mpegtsmux: Test we don't crash releasing unused pad

Part-of: <!1411>
parent 076189e2
Pipeline #172734 waiting for manual action with stages
in 54 seconds
......@@ -388,6 +388,38 @@ GST_START_TEST (test_reappearing_pad)
GST_END_TEST;
GST_START_TEST (test_unused_pad)
{
gchar *padname;
GstElement *mux;
GstPad *pad;
mux = gst_check_setup_element ("mpegtsmux");
mysrcpad = setup_src_pad (mux, &video_src_template, "sink_%d", &padname);
mysinkpad = gst_check_setup_sink_pad (mux, &sink_template);
gst_pad_set_active (mysrcpad, TRUE);
gst_pad_set_active (mysinkpad, TRUE);
fail_unless (gst_element_set_state (mux,
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
pad = gst_element_get_static_pad (mux, padname);
gst_pad_set_active (mysrcpad, FALSE);
teardown_src_pad (mux, padname);
gst_element_release_request_pad (mux, pad);
gst_object_unref (pad);
g_free (padname);
mysrcpad = setup_src_pad (mux, &video_src_template, "sink_%d", &padname);
gst_pad_set_active (mysrcpad, TRUE);
cleanup_tsmux (mux, padname);
g_free (padname);
}
GST_END_TEST;
GST_START_TEST (test_video)
{
check_tsmux_pad (&video_src_template, VIDEO_CAPS_STRING, 0xE0, 0x1b,
......@@ -526,6 +558,7 @@ mpegtsmux_suite (void)
tcase_add_test (tc_chain, test_align);
tcase_add_test (tc_chain, test_keyframe_flag_propagation);
tcase_add_test (tc_chain, test_reappearing_pad);
tcase_add_test (tc_chain, test_unused_pad);
return s;
}
......
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