mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-21 06:38:19 +00:00
flvmux: Fix unit test to correctly handle request pads
Request pads are removed by the element instance in PAUSED->READY so we need to re-request pads for every run and link them again. Last fix for bug #590447.
This commit is contained in:
parent
8b9d547c14
commit
a931c67597
1 changed files with 13 additions and 9 deletions
|
@ -50,7 +50,6 @@ static void
|
|||
mux_pcm_audio (guint num_buffers, guint repeat)
|
||||
{
|
||||
GstElement *src, *sink, *flvmux, *pipeline;
|
||||
GstPad *sinkpad, *srcpad;
|
||||
gint counter;
|
||||
|
||||
GST_LOG ("num_buffers = %u", num_buffers);
|
||||
|
@ -78,22 +77,27 @@ mux_pcm_audio (guint num_buffers, guint repeat)
|
|||
|
||||
gst_bin_add_many (GST_BIN (pipeline), src, flvmux, sink, NULL);
|
||||
|
||||
/* now link the elements */
|
||||
sinkpad = gst_element_get_request_pad (flvmux, "audio");
|
||||
fail_unless (sinkpad != NULL, "Could not get audio request pad");
|
||||
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL, "Could not get audiotestsrc's source pad");
|
||||
|
||||
fail_unless_equals_int (gst_pad_link (srcpad, sinkpad), GST_PAD_LINK_OK);
|
||||
fail_unless (gst_element_link (flvmux, sink));
|
||||
|
||||
do {
|
||||
GstStateChangeReturn state_ret;
|
||||
GstMessage *msg;
|
||||
GstPad *sinkpad, *srcpad;
|
||||
|
||||
GST_LOG ("repeat=%d", repeat);
|
||||
|
||||
/* now link the elements */
|
||||
sinkpad = gst_element_get_request_pad (flvmux, "audio");
|
||||
fail_unless (sinkpad != NULL, "Could not get audio request pad");
|
||||
|
||||
srcpad = gst_element_get_static_pad (src, "src");
|
||||
fail_unless (srcpad != NULL, "Could not get audiotestsrc's source pad");
|
||||
|
||||
fail_unless_equals_int (gst_pad_link (srcpad, sinkpad), GST_PAD_LINK_OK);
|
||||
|
||||
gst_object_unref (srcpad);
|
||||
gst_object_unref (sinkpad);
|
||||
|
||||
counter = 0;
|
||||
|
||||
state_ret = gst_element_set_state (pipeline, GST_STATE_PAUSED);
|
||||
|
|
Loading…
Reference in a new issue