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 @@ ...@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc * open.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * 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> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -685,27 +685,30 @@ void OpenDialog::UpdateMRL( int i_access_method ) ...@@ -685,27 +685,30 @@ void OpenDialog::UpdateMRL( int i_access_method )
switch( i_net_type ) switch( i_net_type )
{ {
case 0: case 0:
mrltemp = wxT("udp") + demux + wxT("://");
if( i_net_ports[0] != if( i_net_ports[0] !=
config_GetInt( p_intf, "server-port" ) ) config_GetInt( p_intf, "server-port" ) )
{ {
mrltemp = wxT("udp") + demux + mrltemp += wxString::Format( wxT("@:%d"), i_net_ports[0] );
wxString::Format( wxT("://@:%d"),
i_net_ports[0] );
}
else
{
mrltemp = wxT("udp") + demux + wxT("://");
} }
break; break;
case 1: case 1:
mrltemp = wxT("udp") + demux + wxT("://@") + mrltemp = wxT("udp") + demux + wxT("://@");
net_addrs[1]->GetLineText(0); if ((net_addrs[1]->GetLineText(0).Find (':') != -1)
if( i_net_ports[1] != && (net_addrs[1]->GetLineText(0)[0u] != '['))
config_GetInt( p_intf, "server-port" ) ) {
/* 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"), mrltemp += wxString::Format( wxT(":%d"), i_net_ports[1] );
i_net_ports[1] );
} }
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* streamout.cpp : wxWindows plugin for vlc * streamout.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * 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> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -334,7 +334,16 @@ void SoutDialog::UpdateMRL() ...@@ -334,7 +334,16 @@ void SoutDialog::UpdateMRL()
if( !dup_opts.IsEmpty() ) dup_opts += wxT(","); if( !dup_opts.IsEmpty() ) dup_opts += wxT(",");
dup_opts += wxT("dst=std{access=udp,mux="); dup_opts += wxT("dst=std{access=udp,mux=");
dup_opts += encapsulation + wxT(",url="); 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"), dup_opts += wxString::Format( wxT(":%d"),
net_ports[UDP_ACCESS_OUT]->GetValue() ); 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