mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 11:10:37 +00:00
tests: souphttpsrc: don't try to connect to dead radio server
This commit is contained in:
parent
ba8cda54f4
commit
dd1bd2beb3
1 changed files with 16 additions and 39 deletions
|
@ -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;
|
||||
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;
|
||||
}
|
||||
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
done:
|
||||
icy_caps = FALSE;
|
||||
|
||||
gst_element_set_state (pipe, GST_STATE_NULL);
|
||||
|
|
Loading…
Reference in a new issue