tests/netsim: Set src caps before creating buffers

GstHarness requires the source pad caps to be set before
buffer allocations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2179>
This commit is contained in:
Doug Nazar 2021-04-20 23:51:49 -04:00 committed by GStreamer Marge Bot
parent 817544860d
commit be2996c48e

View file

@ -29,10 +29,12 @@ GST_START_TEST (netsim_stress_delayed)
{
GstHarness *h = gst_harness_new_parse ("netsim delay-probability=0.5");
GstCaps *caps = gst_caps_from_string ("mycaps");
GstBuffer *buf = gst_harness_create_buffer (h, 100);
GstBuffer *buf;
GstHarnessThread *state, *push;
GstSegment segment;
gst_harness_set_src_caps (h, gst_caps_ref (caps));
buf = gst_harness_create_buffer (h, 100);
gst_segment_init (&segment, GST_FORMAT_TIME);
state = gst_harness_stress_statechange_start (h);
push = gst_harness_stress_push_buffer_start (h, caps, &segment, buf);