summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2009-04-21 16:48:39 +0200
committerEdward Hervey <bilboed@bilboed.com>2009-04-21 16:48:39 +0200
commita025f156a5d15c72138f18da78bcf9fffd9fda5f (patch)
treea2017f2142fa08c4b18db785973638a2b15e7eb8 /ext
parentc717af5c0ab19a9d747c7e5e43b776f0e8e57378 (diff)
downloadgst-plugins-bad-a025f156a5d15c72138f18da78bcf9fffd9fda5f.tar.gz
gst-plugins-bad-a025f156a5d15c72138f18da78bcf9fffd9fda5f.tar.bz2
gst-plugins-bad-a025f156a5d15c72138f18da78bcf9fffd9fda5f.zip
mmssrc: If the connection fails, emit a redirection msg to the rtsp equivalent.
This should help fix the issue with Windows Media Server using rtsp... but still declaring the stream with mms://
Diffstat (limited to 'ext')
-rw-r--r--ext/libmms/gstmms.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/ext/libmms/gstmms.c b/ext/libmms/gstmms.c
index f04e410f..dc004e81 100644
--- a/ext/libmms/gstmms.c
+++ b/ext/libmms/gstmms.c
@@ -460,8 +460,18 @@ gst_mms_start (GstBaseSrc * bsrc)
GST_DEBUG_OBJECT (mms, "Connect successful");
return TRUE;
} else {
- GST_ELEMENT_ERROR (mms, RESOURCE, OPEN_READ,
- ("Could not connect to this stream"), (NULL));
+ gchar *url, *location;
+
+ GST_ERROR_OBJECT (mms,
+ "Could not connect to this stream, redirecting to rtsp");
+ location = gst_uri_get_location (mms->uri_name);
+ url = g_strdup_printf ("rtsp://%s", location);
+ g_free (location);
+
+ gst_element_post_message (GST_ELEMENT_CAST (mms),
+ gst_message_new_element (GST_OBJECT_CAST (mms),
+ gst_structure_new ("redirect", "new-location", G_TYPE_STRING, url,
+ NULL)));
return FALSE;
}