+namespace {
+
+// Does not support passwords, only user:host, since this is really only used
+// to parse VLC's udp://source@multicastgroup:1234/ syntax (we do not support
+// even basic auth).
+void split_user_host(const string &user_host, string *user, string *host)
+{
+ size_t split = user_host.find("@");
+ if (split == string::npos) {
+ user->clear();
+ *host = user_host;
+ } else {
+ *user = string(user_host.begin(), user_host.begin() + split);
+ *host = string(user_host.begin() + split + 1, user_host.end());
+ }
+}
+
+} // namespace
+