Commit 31d87e5d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Automatically adds [ and ] around IPv6 addresses in Media Resource Locator.

parent 9e1d63b5
......@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: open.cpp,v 1.47 2003/12/09 19:15:03 yoann Exp $
* $Id: open.cpp,v 1.48 2003/12/10 11:04:25 courmisch Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -685,27 +685,30 @@ void OpenDialog::UpdateMRL( int i_access_method )
switch( i_net_type )
{
case 0:
mrltemp = wxT("udp") + demux + wxT("://");
if( i_net_ports[0] !=
config_GetInt( p_intf, "server-port" ) )
{
mrltemp = wxT("udp") + demux +
wxString::Format( wxT("://@:%d"),
i_net_ports[0] );
}
else
{
mrltemp = wxT("udp") + demux + wxT("://");
mrltemp += wxString::Format( wxT("@:%d"), i_net_ports[0] );
}
break;
case 1:
mrltemp = wxT("udp") + demux + wxT("://@") +
net_addrs[1]->GetLineText(0);
if( i_net_ports[1] !=
config_GetInt( p_intf, "server-port" ) )
mrltemp = wxT("udp") + demux + wxT("://@");
if ((net_addrs[1]->GetLineText(0).Find (':') != -1)
&& (net_addrs[1]->GetLineText(0)[0u] != '['))
{
/* automatically adds '[' and ']' to IPv6 addresses */
mrltemp += wxT("[") + net_addrs[1]->GetLineText(0)
+ wxT("]");
}
else
{
mrltemp += net_addrs[1]->GetLineText(0);
}
if( i_net_ports[1] != config_GetInt( p_intf, "server-port" ) )
{
mrltemp = mrltemp + wxString::Format( wxT(":%d"),
i_net_ports[1] );
mrltemp += wxString::Format( wxT(":%d"), i_net_ports[1] );
}
break;
......
......@@ -2,7 +2,7 @@
* streamout.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: streamout.cpp,v 1.37 2003/11/27 10:34:51 gbazin Exp $
* $Id: streamout.cpp,v 1.38 2003/12/10 11:04:25 courmisch Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -334,7 +334,16 @@ void SoutDialog::UpdateMRL()
if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
dup_opts += wxT("dst=std{access=udp,mux=");
dup_opts += encapsulation + wxT(",url=");
dup_opts += net_addrs[UDP_ACCESS_OUT]->GetLineText(0);
wxString udp_addr = net_addrs[UDP_ACCESS_OUT]->GetLineText(0);
if ((udp_addr[0u] != '[') && (udp_addr.Find(':') != -1))
{
dup_opts += wxT ("[") + udp_addr + wxT ("]");
}
else
{
dup_opts += udp_addr;
}
dup_opts += wxString::Format( wxT(":%d"),
net_ports[UDP_ACCESS_OUT]->GetValue() );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment