static gpointer
push_buffer_async (GstPad * pad)
{
- return GINT_TO_POINTER (gst_pad_push (pad, gst_buffer_new ()));
+ gpointer ret = GINT_TO_POINTER (gst_pad_push (pad, gst_buffer_new ()));
+ gst_object_unref (pad);
+ return ret;
}
static void
id = gst_pad_add_probe (pad, type, block_async_cb_return_ok, NULL, NULL);
thread = g_thread_try_new ("gst-check", (GThreadFunc) push_buffer_async,
- pad, NULL);
+ gst_object_ref (pad), NULL);
/* wait for the block */
while (!gst_pad_is_blocking (pad)) {
add_idle_probe_async (GstPad * pad)
{
gst_pad_add_probe (pad, GST_PAD_PROBE_TYPE_IDLE, idle_probe_wait, NULL, NULL);
+ gst_object_unref (pad);
return NULL;
}
idle_probe_running = FALSE;
idle_thread =
- g_thread_try_new ("gst-check", (GThreadFunc) add_idle_probe_async, srcpad,
- NULL);
+ g_thread_try_new ("gst-check", (GThreadFunc) add_idle_probe_async,
+ gst_object_ref (srcpad), NULL);
/* wait for the idle function to signal it is being called */
while (!idle_probe_running) {
}
thread = g_thread_try_new ("gst-check", (GThreadFunc) push_buffer_async,
- srcpad, NULL);
+ gst_object_ref (srcpad), NULL);
while (!gst_pad_is_blocking (srcpad)) {
g_usleep (10000);
GstFlowReturn res = gst_pad_pull_range (pad, 0, 100, &buf);
if (buf)
gst_buffer_unref (buf);
+ gst_object_unref (pad);
+
return GINT_TO_POINTER (res);
}
block_async_cb_return_ok, NULL, NULL);
thread = g_thread_try_new ("gst-check", (GThreadFunc) pull_range_async,
- sinkpad, NULL);
+ gst_object_ref (sinkpad), NULL);
/* wait for the block */
while (!gst_pad_is_blocking (sinkpad)) {
idle_probe_called = FALSE;
get_range_wait = TRUE;
thread = g_thread_try_new ("gst-check", (GThreadFunc) pull_range_async,
- sinkpad, NULL);
+ gst_object_ref (sinkpad), NULL);
/* wait for the block */
while (!getrange_waiting) {
pull_probe_called_with_bad_data = FALSE;
thread = g_thread_try_new ("gst-check", (GThreadFunc) pull_range_async,
- sinkpad, NULL);
+ gst_object_ref (sinkpad), NULL);
/* wait for the block */
while (!pull_probe_called && !pull_probe_called_with_bad_data
fail_unless (pad->num_blocked == 1);
thread = g_thread_try_new ("gst-check", (GThreadFunc) push_buffer_async,
- pad, NULL);
+ gst_object_ref (pad), NULL);
/* wait for the block */
while (!gst_pad_is_blocking (pad))