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)
|
mux_pcm_audio (guint num_buffers, guint repeat)
|
||||||
{
|
{
|
||||||
GstElement *src, *sink, *flvmux, *pipeline;
|
GstElement *src, *sink, *flvmux, *pipeline;
|
||||||
GstPad *sinkpad, *srcpad;
|
|
||||||
gint counter;
|
gint counter;
|
||||||
|
|
||||||
GST_LOG ("num_buffers = %u", num_buffers);
|
GST_LOG ("num_buffers = %u", num_buffers);
|
||||||
|
@ -78,6 +77,15 @@ mux_pcm_audio (guint num_buffers, guint repeat)
|
||||||
|
|
||||||
gst_bin_add_many (GST_BIN (pipeline), src, flvmux, sink, NULL);
|
gst_bin_add_many (GST_BIN (pipeline), src, flvmux, sink, NULL);
|
||||||
|
|
||||||
|
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 */
|
/* now link the elements */
|
||||||
sinkpad = gst_element_get_request_pad (flvmux, "audio");
|
sinkpad = gst_element_get_request_pad (flvmux, "audio");
|
||||||
fail_unless (sinkpad != NULL, "Could not get audio request pad");
|
fail_unless (sinkpad != NULL, "Could not get audio request pad");
|
||||||
|
@ -86,13 +94,9 @@ mux_pcm_audio (guint num_buffers, guint repeat)
|
||||||
fail_unless (srcpad != NULL, "Could not get audiotestsrc's source pad");
|
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_equals_int (gst_pad_link (srcpad, sinkpad), GST_PAD_LINK_OK);
|
||||||
fail_unless (gst_element_link (flvmux, sink));
|
|
||||||
|
|
||||||
do {
|
gst_object_unref (srcpad);
|
||||||
GstStateChangeReturn state_ret;
|
gst_object_unref (sinkpad);
|
||||||
GstMessage *msg;
|
|
||||||
|
|
||||||
GST_LOG ("repeat=%d", repeat);
|
|
||||||
|
|
||||||
counter = 0;
|
counter = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue