Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
5b00f5cf
Commit
5b00f5cf
authored
Jun 06, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: fix handling of IPv6 literal for RTP and UDP
See
http://forum.videolan.org/viewtopic.php?f=33&t=60477
parent
87cb4e59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
29 deletions
+31
-29
modules/gui/qt4/components/open_panels.cpp
modules/gui/qt4/components/open_panels.cpp
+31
-29
No files found.
modules/gui/qt4/components/open_panels.cpp
View file @
5b00f5cf
...
@@ -561,12 +561,7 @@ void NetOpenPanel::updateProtocol( int idx_proto ) {
...
@@ -561,12 +561,7 @@ void NetOpenPanel::updateProtocol( int idx_proto ) {
void
NetOpenPanel
::
updateMRL
()
{
void
NetOpenPanel
::
updateMRL
()
{
QString
mrl
=
""
;
QString
mrl
=
""
;
QString
addr
=
ui
.
addressText
->
text
();
QString
addr
=
ui
.
addressText
->
text
();
addr
=
QUrl
::
toPercentEncoding
(
addr
,
":/?#@!$&'()*+,;="
);
int
idx_proto
=
ui
.
protocolCombo
->
currentIndex
();
int
idx_proto
=
ui
.
protocolCombo
->
currentIndex
();
int
addr_is_multicast
=
addr
.
contains
(
QRegExp
(
"^(22[4-9])|(23
\\
d)|(
\\
[?[fF]{2}[0-9a-fA-F]{2}:)"
))
?
1
:
0
;
int
addr_is_ipv4
=
addr
.
contains
(
QRegExp
(
"^
\\
d{1,3}[.]
\\
d{1,3}[.]
\\
d{1,3}[.]
\\
d{1,3}"
))
?
1
:
0
;
int
addr_is_ipv6
=
addr
.
contains
(
QRegExp
(
":[a-fA-F0-9]{1,4}:"
))
?
1
:
0
;
int
addr_has_port
=
addr
.
contains
(
QRegExp
(
"[^:]{5}:
\\
d{1,5}$"
))
?
1
:
0
;
if
(
addr
.
contains
(
"://"
))
if
(
addr
.
contains
(
"://"
))
{
{
/* Match the correct item in the comboBox */
/* Match the correct item in the comboBox */
...
@@ -597,33 +592,40 @@ void NetOpenPanel::updateMRL() {
...
@@ -597,33 +592,40 @@ void NetOpenPanel::updateMRL() {
mrl
=
"rtsp://"
+
addr
;
mrl
=
"rtsp://"
+
addr
;
emit
methodChanged
(
"rtsp-caching"
);
emit
methodChanged
(
"rtsp-caching"
);
break
;
break
;
case
RTP_PROTO
:
case
UDP_PROTO
:
case
UDP_PROTO
:
if
((
addr_is_multicast
)
||
(
!
addr_is_ipv4
&&
!
addr_is_ipv6
))
mrl
=
qfu
(((
idx_proto
==
RTP_PROTO
)
?
"rtp"
:
"udp"
));
mrl
=
"udp://@"
;
mrl
+=
qfu
(
"://"
);
else
if
(
addr
[
0
]
==
':'
)
/* Port number without address */
mrl
=
"udp://"
;
mrl
+=
addr
;
/* Add [] to IPv6 */
else
if
(
addr_is_ipv6
&&
!
addr
.
contains
(
'['
)
)
{
{
mrl
+=
"["
+
addr
+
"]"
;
mrl
+=
qfu
(
"@"
);
switch
(
addr
.
count
(
":"
)
)
{
case
0
:
/* DNS or IPv4 literal, no port number */
mrl
+=
addr
;
mrl
+=
QString
(
":%1"
).
arg
(
ui
.
portSpin
->
value
()
);
break
;
case
1
:
/* DNS or IPv4 literal plus port number */
mrl
+=
addr
;
break
;
default:
/* IPv6 literal */
if
(
!
addr
.
contains
(
"]:"
)
)
{
if
(
addr
[
0
]
!=
'['
)
/* Missing brackets */
mrl
+=
qfu
(
"["
)
+
addr
+
qfu
(
"]"
);
else
mrl
+=
addr
;
mrl
+=
QString
(
":%1"
).
arg
(
ui
.
portSpin
->
value
()
);
}
else
/* Brackets present, port present */
mrl
+=
addr
;
break
;
}
}
}
else
mrl
+=
addr
;
emit
methodChanged
(
idx_proto
==
RTP_PROTO
if
(
!
addr_has_port
)
?
"rtp-caching"
:
"udp-caching"
);
mrl
+=
QString
(
":%1"
).
arg
(
ui
.
portSpin
->
value
()
);
emit
methodChanged
(
"udp-caching"
);
break
;
case
RTP_PROTO
:
if
((
addr_is_multicast
)
||
(
!
addr_is_ipv4
&&
!
addr_is_ipv6
))
mrl
=
"rtp://@"
;
else
mrl
=
"rtp://"
;
if
(
addr_is_ipv6
&&
!
addr
.
contains
(
'['
)
)
mrl
+=
"["
+
addr
+
"]"
;
/* Add [] to IPv6 */
else
mrl
+=
addr
;
if
(
!
addr_has_port
)
mrl
+=
QString
(
":%1"
).
arg
(
ui
.
portSpin
->
value
()
);
emit
methodChanged
(
"rtp-caching"
);
break
;
break
;
case
RTMP_PROTO
:
case
RTMP_PROTO
:
mrl
=
"rtmp://"
+
addr
;
mrl
=
"rtmp://"
+
addr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment