[vlc-devel] commit: Fix the '@' disappearance in UDP addresses. (Jean-Baptiste Kempf )
git version control
git at videolan.org
Sat Mar 22 08:13:21 CET 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Mar 22 00:12:18 2008 -0700| [bb8d2b9ef14a3b7ec140f43e149f10573f67a54e]
Fix the '@' disappearance in UDP addresses.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bb8d2b9ef14a3b7ec140f43e149f10573f67a54e
---
modules/gui/qt4/components/open_panels.cpp | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp
index 883f0a6..c187aa7 100644
--- a/modules/gui/qt4/components/open_panels.cpp
+++ b/modules/gui/qt4/components/open_panels.cpp
@@ -452,11 +452,15 @@ void NetOpenPanel::updateProtocol( int idx ) {
void NetOpenPanel::updateMRL() {
QString mrl = "";
QString addr = ui.addressText->text();
+ addr = QUrl::toPercentEncoding( addr, ":/?#@!$&'()*+,;=" );
int proto = ui.protocolCombo->currentIndex();
- if( addr.contains( "://") && proto != 5 ) {
+ if( addr.contains( "://") && ( proto != 5 || proto != 6 ) )
+ {
mrl = addr;
- } else {
+ }
+ else
+ {
switch( proto ) {
case 0:
mrl = "http://" + addr;
@@ -480,7 +484,8 @@ void NetOpenPanel::updateMRL() {
break;
case 5:
mrl = "udp://@";
- if( ui.ipv6->isEnabled() && ui.ipv6->isChecked() ) {
+ if( ui.ipv6->isEnabled() && ui.ipv6->isChecked() )
+ {
mrl += "[::]";
}
mrl += QString(":%1").arg( ui.portSpin->value() );
@@ -489,16 +494,18 @@ void NetOpenPanel::updateMRL() {
case 6: /* UDP multicast */
mrl = "udp://@";
/* Add [] to IPv6 */
- if ( addr.contains(':') && !addr.contains('[') ) {
+ if ( addr.contains(':') && !addr.contains('[') )
+ {
mrl += "[" + addr + "]";
- } else mrl += addr;
+ }
+ else mrl += addr;
mrl += QString(":%1").arg( ui.portSpin->value() );
emit methodChanged("udp-caching");
}
}
// Encode the boring stuffs
- mrl = QUrl( mrl ).toEncoded();
+
if( ui.timeShift->isEnabled() && ui.timeShift->isChecked() ) {
mrl += " :access-filter=timeshift";
}
More information about the vlc-devel
mailing list