summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOgnyan Tonchev <ognyan@axis.com>2013-06-17 16:47:56 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2013-06-17 17:18:40 +0200
commitd9e245e62eeb9792d2eac3e0c84710c968a1d84f (patch)
tree65156765c85511c257e163e0a3238ad10d7c9226 /tests
parent7e9df0e112c0074bda4305294a623efdcd54979c (diff)
downloadgstreamer-d9e245e62eeb9792d2eac3e0c84710c968a1d84f.tar.gz
rtsp-media: Do not leak the element in take_pipeline
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702470
Diffstat (limited to 'tests')
-rw-r--r--tests/check/gst/media.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/check/gst/media.c b/tests/check/gst/media.c
index 874a207eae..dd814cfec8 100644
--- a/tests/check/gst/media.c
+++ b/tests/check/gst/media.c
@@ -237,6 +237,31 @@ GST_START_TEST (test_media_dyn_prepare)
GST_END_TEST;
+GST_START_TEST (test_media_take_pipeline)
+{
+ GstRTSPMediaFactory *factory;
+ GstRTSPMedia *media;
+ GstRTSPUrl *url;
+ GstElement *pipeline;
+
+ factory = gst_rtsp_media_factory_new ();
+ gst_rtsp_url_parse ("rtsp://localhost:8554/test", &url);
+ gst_rtsp_media_factory_set_launch (factory,
+ "( fakesrc ! text/plain ! rtpgstpay name=pay0 )");
+
+ media = gst_rtsp_media_factory_construct (factory, url);
+ fail_unless (GST_IS_RTSP_MEDIA (media));
+
+ pipeline = gst_pipeline_new ("media-pipeline");
+ gst_rtsp_media_take_pipeline (media, GST_PIPELINE_CAST (pipeline));
+
+ g_object_unref (media);
+ gst_rtsp_url_free (url);
+ g_object_unref (factory);
+}
+
+GST_END_TEST;
+
static Suite *
rtspmedia_suite (void)
{
@@ -249,6 +274,7 @@ rtspmedia_suite (void)
tcase_add_test (tc, test_media);
tcase_add_test (tc, test_media_prepare);
tcase_add_test (tc, test_media_dyn_prepare);
+ tcase_add_test (tc, test_media_take_pipeline);
return s;
}