diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2015-08-21 11:52:19 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-08-21 11:52:19 +0100 |
commit | dd1bd2beb33e3e430f9bc92df1f5cdd12b0e0bd9 (patch) | |
tree | 1ab7f01e59dd79536fac7ae15166d435cbbb44d7 | |
parent | ba8cda54f4de27817e9e5460c6a48e24b9012f41 (diff) |
tests: souphttpsrc: don't try to connect to dead radio server
-rw-r--r-- | tests/check/elements/souphttpsrc.c | 55 |
1 files changed, 16 insertions, 39 deletions
diff --git a/tests/check/elements/souphttpsrc.c b/tests/check/elements/souphttpsrc.c index d265d7608..c2a7c5739 100644 --- a/tests/check/elements/souphttpsrc.c +++ b/tests/check/elements/souphttpsrc.c @@ -387,34 +387,9 @@ GST_START_TEST (test_icy_stream) gst_bin_add (GST_BIN (pipe), sink); fail_unless (gst_element_link (src, sink)); - /* First try Virgin Radio Ogg stream, to see if there's connectivity and all - * (which is an attempt to work around the completely horrid error reporting - * and that we can't distinguish different types of failures here). */ - - g_object_set (src, "location", "http://ogg2.smgradio.com/vr32.ogg", NULL); - g_object_set (src, "num-buffers", 1, NULL); - icy_caps = FALSE; - gst_element_set_state (pipe, GST_STATE_PLAYING); - - msg = gst_bus_poll (GST_ELEMENT_BUS (pipe), - GST_MESSAGE_EOS | GST_MESSAGE_ERROR, -1); - if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) { - GST_INFO ("looks like there's no net connectivity or sgmradio.com is " - "down. In any case, let's just skip this test"); - gst_message_unref (msg); - goto done; - } - gst_message_unref (msg); - msg = NULL; - gst_element_set_state (pipe, GST_STATE_NULL); - - /* Now, if the ogg stream works, the mp3 shoutcast stream should work as - * well (time will tell if that's true) */ - /* Virgin Radio 32kbps mp3 shoutcast stream */ g_object_set (src, "location", "http://mp3-vr-32.smgradio.com:80/", NULL); - /* EOS after the first buffer */ g_object_set (src, "num-buffers", 1, NULL); icy_caps = TRUE; @@ -422,22 +397,24 @@ GST_START_TEST (test_icy_stream) msg = gst_bus_poll (GST_ELEMENT_BUS (pipe), GST_MESSAGE_EOS | GST_MESSAGE_ERROR, -1); - if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_EOS) { - GST_DEBUG ("success, we're done here"); - gst_message_unref (msg); - goto done; - } - - { - GError *err = NULL; - - gst_message_parse_error (msg, &err, NULL); - gst_message_unref (msg); - g_error ("Error with ICY mp3 shoutcast stream: %s", err->message); - g_error_free (err); + switch (GST_MESSAGE_TYPE (msg)) { + case GST_MESSAGE_EOS: + GST_DEBUG ("success, we're done here"); + gst_message_unref (msg); + break; + case GST_MESSAGE_ERROR:{ + GError *err = NULL; + + gst_message_parse_error (msg, &err, NULL); + GST_INFO ("Error with ICY mp3 shoutcast stream: %s", err->message); + gst_message_unref (msg); + g_clear_error (&err); + break; + } + default: + break; } -done: icy_caps = FALSE; gst_element_set_state (pipe, GST_STATE_NULL); |