Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
13a79c4f
Commit
13a79c4f
authored
Nov 04, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore missing TTL in c= line.
It was about time I fix VLC to accept SAP announces on my campus.
parent
f30d703a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
58 deletions
+32
-58
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+32
-58
No files found.
modules/services_discovery/sap.c
View file @
13a79c4f
...
@@ -665,8 +665,6 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf,
...
@@ -665,8 +665,6 @@ static int ParseSAP( services_discovery_t *p_sd, const uint8_t *buf,
assert
(
buf
[
len
]
==
'\0'
);
assert
(
buf
[
len
]
==
'\0'
);
msg_Dbg
(
p_sd
,
"SDP:
\n
%s"
,
psz_sdp
);
/* Skip payload type */
/* Skip payload type */
/* SAPv1 has implicit "application/sdp" payload type: first line is v=0 */
/* SAPv1 has implicit "application/sdp" payload type: first line is v=0 */
if
(
strncmp
(
psz_sdp
,
"v=0"
,
3
))
if
(
strncmp
(
psz_sdp
,
"v=0"
,
3
))
...
@@ -850,69 +848,43 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
...
@@ -850,69 +848,43 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
{
{
char
*
psz_eof
=
NULL
;
char
*
psz_eof
=
NULL
;
char
*
psz_parse
=
NULL
;
char
*
psz_parse
=
NULL
;
char
*
psz_uri
=
NULL
;
char
psz_uri
[
1026
]
;
char
*
psz_proto
=
NULL
;
char
*
psz_proto
=
NULL
;
int
i_port
=
0
;
int
i_port
=
0
;
/* Parse c= field */
/* Parse c= field */
if
(
p_sdp
->
psz_connection
)
if
(
p_sdp
->
psz_connection
)
{
{
psz_parse
=
p_sdp
->
psz_connection
;
char
hostname
[
1024
];
int
ipv
;
psz_eof
=
strchr
(
psz_parse
,
' '
);
if
(
psz_eof
)
/*
{
* NOTE: we ignore the TTL parameter on-purpose, as some SAP
*
psz_eof
=
'\0'
;
* advertisers don't include it (and it is utterly useless).
psz_parse
=
psz_eof
+
1
;
*/
}
if
(
sscanf
(
p_sdp
->
psz_connection
,
"IN IP%d %1023[^/]"
,
&
ipv
,
else
hostname
)
!=
2
)
{
{
msg_Warn
(
p_obj
,
"unable to parse c field (1)"
);
msg_Warn
(
p_obj
,
"unable to parse c field:
\"
%s
\"
"
,
p_sdp
->
psz_connection
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
psz_eof
=
strchr
(
psz_parse
,
' '
);
switch
(
ipv
)
if
(
psz_eof
)
{
*
psz_eof
=
'\0'
;
if
(
!
strncmp
(
psz_parse
,
"IP4"
,
3
)
)
{
p_sdp
->
i_in
=
4
;
}
else
if
(
!
strncmp
(
psz_parse
,
"IP6"
,
3
)
)
{
p_sdp
->
i_in
=
6
;
}
else
{
{
p_sdp
->
i_in
=
0
;
case
4
:
}
case
6
:
psz_parse
=
psz_eof
+
1
;
break
;
}
else
default:
{
msg_Warn
(
p_obj
,
"unknown IP version %d"
,
ipv
);
msg_Warn
(
p_obj
,
"unable to parse c field (2)"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
psz_eof
=
strchr
(
psz_parse
,
'/'
);
if
(
strchr
(
hostname
,
':'
)
!=
NULL
)
sprintf
(
psz_uri
,
"[%s]"
,
hostname
);
if
(
psz_eof
)
{
*
psz_eof
=
'\0'
;
}
else
else
{
strcpy
(
psz_uri
,
hostname
);
msg_Dbg
(
p_obj
,
"incorrect c field, %s"
,
p_sdp
->
psz_connection
);
}
if
(
p_sdp
->
i_in
==
6
&&
(
isxdigit
(
*
psz_parse
)
||
*
psz_parse
==
':'
)
)
{
asprintf
(
&
psz_uri
,
"[%s]"
,
psz_parse
);
}
else
psz_uri
=
strdup
(
psz_parse
);
}
}
/* Parse m= field */
/* Parse m= field */
...
@@ -926,11 +898,16 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
...
@@ -926,11 +898,16 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
{
{
*
psz_eof
=
'\0'
;
*
psz_eof
=
'\0'
;
if
(
strncmp
(
psz_parse
,
"audio"
,
5
)
&&
/*
strncmp
(
psz_parse
,
"video"
,
5
)
)
* That's ugly. We should go through every media, and make sure
* at least one of them is audio or video. In the mean time, I
* need to accept data too.
*/
if
(
strncmp
(
psz_parse
,
"audio"
,
5
)
&&
strncmp
(
psz_parse
,
"video"
,
5
)
&&
strncmp
(
psz_parse
,
"data"
,
4
)
)
{
{
msg_Warn
(
p_obj
,
"unhandled media type -%s-"
,
psz_parse
);
msg_Warn
(
p_obj
,
"unhandled media type
\"
%s
\"
"
,
psz_parse
);
FREENULL
(
psz_uri
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -939,7 +916,6 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
...
@@ -939,7 +916,6 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
else
else
{
{
msg_Warn
(
p_obj
,
"unable to parse m field (1)"
);
msg_Warn
(
p_obj
,
"unable to parse m field (1)"
);
FREENULL
(
psz_uri
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -962,7 +938,6 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
...
@@ -962,7 +938,6 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
else
else
{
{
msg_Warn
(
p_obj
,
"unable to parse m field (2)"
);
msg_Warn
(
p_obj
,
"unable to parse m field (2)"
);
FREENULL
(
psz_uri
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -1022,7 +997,6 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
...
@@ -1022,7 +997,6 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
asprintf
(
&
p_sdp
->
psz_uri
,
"%s://%s@%s:%i"
,
psz_proto
,
psz_source
,
asprintf
(
&
p_sdp
->
psz_uri
,
"%s://%s@%s:%i"
,
psz_proto
,
psz_source
,
psz_uri
,
i_port
);
psz_uri
,
i_port
);
FREENULL
(
psz_uri
);
FREENULL
(
psz_proto
);
FREENULL
(
psz_proto
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
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