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
da014eb8
Commit
da014eb8
authored
Dec 10, 2002
by
Arnaud Schauly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed a segfault under windows.
parent
0c091c92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
126 additions
and
125 deletions
+126
-125
modules/misc/sap.c
modules/misc/sap.c
+126
-125
No files found.
modules/misc/sap.c
View file @
da014eb8
...
...
@@ -2,7 +2,7 @@
* sap.c : SAP interface module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: sap.c,v 1.
4 2002/12/06 22:44:03
gitan Exp $
* $Id: sap.c,v 1.
5 2002/12/10 00:02:29
gitan Exp $
*
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
*
...
...
@@ -68,7 +68,7 @@
/* SAP is always on that port */
#define HELLO_PORT 9875
#define HELLO_GROUP "2
39.255.255.255"
#define HELLO_GROUP "2
24.2.127.254"
#define ADD_SESSION 1
/*****************************************************************************
...
...
@@ -201,7 +201,6 @@ static void Run( intf_thread_t *p_intf )
while
(
!
p_intf
->
b_die
)
{
int
i_read
;
addrlen
=
sizeof
(
addr
);
...
...
@@ -268,7 +267,6 @@ static int sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
playlist_t
*
p_playlist
;
psz_uri_default
=
NULL
;
cfield_parse
(
p_sd
->
psz_connection
,
&
psz_uri_default
);
for
(
i_count
=
0
;
i_count
<=
p_sd
->
i_media
;
i_count
++
)
...
...
@@ -324,6 +322,7 @@ static int sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
/* Filling p_item->psz_uri */
i_multicast
=
ismult
(
psz_uri
);
p_item
->
psz_uri
=
malloc
(
strlen
(
psz_proto
)
+
strlen
(
psz_uri
)
+
strlen
(
psz_port
)
+
5
+
i_multicast
);
if
(
p_item
->
psz_uri
==
NULL
)
...
...
@@ -377,18 +376,18 @@ static void cfield_parse( char *psz_cfield, char **ppsz_uri )
{
psz_pos
=
psz_cfield
;
while
(
*
psz_pos
&&
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'\0'
)
while
(
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'\0'
)
{
psz_pos
++
;
}
psz_pos
++
;
while
(
*
psz_pos
&&
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'\0'
)
while
(
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'\0'
)
{
psz_pos
++
;
}
psz_pos
++
;
*
ppsz_uri
=
psz_pos
;
while
(
*
psz_pos
&&
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'/'
while
(
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'/'
&&
*
psz_pos
!=
'\0'
)
{
psz_pos
++
;
...
...
@@ -406,7 +405,7 @@ static void cfield_parse( char *psz_cfield, char **ppsz_uri )
}
/**********************************************************************
* m
c
field_parse
* mfield_parse
*********************************************************************
* put into *ppsz_proto, and *ppsz_port, the protocol and the port.
*********************************************************************/
...
...
@@ -419,20 +418,21 @@ static void mfield_parse( char *psz_mfield, char **ppsz_proto,
if
(
psz_mfield
)
{
psz_pos
=
psz_mfield
;
while
(
*
psz_pos
&&
*
psz_pos
!=
' '
)
while
(
*
psz_pos
!=
'\0'
&&
*
psz_pos
!=
' '
)
{
psz_pos
++
;
}
psz_pos
++
;
*
ppsz_port
=
psz_pos
;
while
(
*
psz_pos
&&
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'/'
)
while
(
*
psz_pos
!=
'\0'
&&
*
psz_pos
&&
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'/'
)
{
psz_pos
++
;
}
if
(
*
psz_pos
==
'/'
)
// FIXME does not support multi-port
{
*
psz_pos
=
'\0'
;
while
(
*
psz_pos
&&
*
psz_pos
!=
' '
)
psz_pos
++
;
while
(
*
psz_pos
!=
'\0'
&&
*
psz_pos
!=
' '
)
{
psz_pos
++
;
}
...
...
@@ -440,7 +440,7 @@ static void mfield_parse( char *psz_mfield, char **ppsz_proto,
*
psz_pos
=
'\0'
;
psz_pos
++
;
*
ppsz_proto
=
psz_pos
;
while
(
*
psz_pos
&&
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'\0'
&&
while
(
*
psz_pos
!=
'\0'
&&
*
psz_pos
!=
' '
&&
*
psz_pos
!=
'/'
)
{
*
psz_pos
=
tolower
(
*
psz_pos
);
...
...
@@ -475,12 +475,11 @@ static int parse_sap( char ** ppsz_sa_packet ) { /* Dummy Parser : does nothin
static
int
packet_handle
(
intf_thread_t
*
p_intf
,
char
**
ppsz_packet
)
{
int
j
=
0
;
sess_descr_t
*
p_sd
;
/* playlist_t *p_playlist;
playlist_item_t *p_item; */
j
=
parse_sap
(
ppsz_packet
);
if
(
j
!=
0
)
{
p_sd
=
parse_sdp
(
*
ppsz_packet
,
p_intf
);
...
...
@@ -530,7 +529,7 @@ static sess_descr_t * parse_sdp( char * psz_pct, intf_thread_t * p_intf )
sd
->
i_media
=-
1
;
j
=
0
;
while
(
psz_pct
[
j
]
!=
EOF
)
while
(
psz_pct
[
j
]
!=
EOF
&&
psz_pct
[
j
]
!=
'\0'
)
{
j
++
;
if
(
psz_pct
[
j
]
==
'='
)
...
...
@@ -609,18 +608,18 @@ static sess_descr_t * parse_sdp( char * psz_pct, intf_thread_t * p_intf )
}
default
:
{
msg_Info
(
p_intf
,
"Warning : Ignored field
\"
%c
\"
"
,
psz_pct
[
j
-
1
]
);
ppsz_fill
=
NULL
;
}
}
k
=
0
;
j
++
;
while
(
psz_pct
[
j
]
!=
'\n'
&&
psz_pct
[
j
]
!=
EOF
)
{
k
++
;
j
++
;
}
j
--
;
if
(
ppsz_fill
!=
NULL
)
{
*
ppsz_fill
=
malloc
(
sizeof
(
char
)
*
(
k
+
1
)
);
...
...
@@ -642,6 +641,7 @@ static void free_sd( sess_descr_t * p_sd )
int
i
;
if
(
p_sd
)
{
FREE
(
p_sd
->
psz_origin
);
FREE
(
p_sd
->
psz_sessionname
);
FREE
(
p_sd
->
psz_information
);
...
...
@@ -695,6 +695,7 @@ static int ismult( char *psz_uri )
free
(
psz_c
);
return
0
;
}
free
(
psz_c
);
return
1
;
}
...
...
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