Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
3eba09d0
Commit
3eba09d0
authored
Nov 09, 2004
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bunch of memory leaks
parent
11704ece
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
8 deletions
+42
-8
TODO
TODO
+1
-2
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+41
-6
No files found.
TODO
View file @
3eba09d0
...
...
@@ -102,8 +102,7 @@ Platform: any
Description: Rewrite the SAP parser
The SAP parser is very dirty at the moment, and needs a complete rewrite.
- caching support<br />
Mostly finished. Closely tied to the new playlist system
Status: Done
Status: Assigned to zorglub (80% done)
Task
Difficulty: Medium
...
...
modules/services_discovery/sap.c
View file @
3eba09d0
...
...
@@ -233,14 +233,14 @@ static int ismult( char * );
static
int
Open
(
vlc_object_t
*
p_this
)
{
services_discovery_t
*
p_sd
=
(
services_discovery_t
*
)
p_this
;
services_discovery_sys_t
*
p_sys
=
malloc
(
sizeof
(
services_discovery_sys_t
)
);
services_discovery_sys_t
*
p_sys
=
(
services_discovery_sys_t
*
)
malloc
(
sizeof
(
services_discovery_sys_t
)
);
playlist_t
*
p_playlist
;
playlist_view_t
*
p_view
;
p_sys
->
i_timeout
=
config_GetInt
(
p_sd
,
"sap-timeout"
);
p_sd
->
pf_run
=
Run
;
p_sd
->
p_sys
=
p_sys
;
...
...
@@ -249,6 +249,7 @@ static int Open( vlc_object_t *p_this )
/* FIXME */
p_sys
->
b_strict
=
VLC_FALSE
;
p_sys
->
b_parse
=
config_GetInt
(
p_sd
,
"sap-parse"
);
if
(
config_GetInt
(
p_sd
,
"sap-cache"
)
)
{
...
...
@@ -318,6 +319,8 @@ static int OpenDemux( vlc_object_t *p_this )
}
}
free
(
p_peek
);
p_demux
->
pf_control
=
Control
;
p_demux
->
pf_demux
=
Demux
;
...
...
@@ -436,6 +439,7 @@ static void Run( services_discovery_t *p_sd )
{
msg_Warn
(
p_sd
,
"socket read error"
);
}
free
(
p_buffer
);
continue
;
}
...
...
@@ -853,6 +857,7 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
strncmp
(
psz_parse
,
"video"
,
5
)
)
{
msg_Warn
(
p_obj
,
"unhandled media type -%s-"
,
psz_parse
);
FREE
(
psz_uri
);
return
VLC_EGENERIC
;
}
...
...
@@ -861,6 +866,7 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
else
{
msg_Warn
(
p_obj
,
"unable to parse m field (1)"
);
FREE
(
psz_uri
);
return
VLC_EGENERIC
;
}
...
...
@@ -883,6 +889,7 @@ static int ParseConnection( vlc_object_t *p_obj, sdp_t *p_sdp )
else
{
msg_Warn
(
p_obj
,
"unable to parse m field (2)"
);
FREE
(
psz_uri
);
return
VLC_EGENERIC
;
}
...
...
@@ -1161,16 +1168,43 @@ static void FreeSDP( sdp_t *p_sdp )
FREE
(
p_sdp
->
psz_connection
);
FREE
(
p_sdp
->
psz_media
);
FREE
(
p_sdp
->
psz_uri
);
for
(
i
=
0
;
i
<
p_sdp
->
i_attributes
;
i
++
)
for
(
i
=
p_sdp
->
i_attributes
-
1
;
i
>=
0
;
i
--
)
{
FREE
(
p_sdp
->
pp_attributes
[
i
]
);
struct
attribute_t
*
p_attr
=
p_sdp
->
pp_attributes
[
i
];
FREE
(
p_sdp
->
pp_attributes
[
i
]
->
psz_field
);
FREE
(
p_sdp
->
pp_attributes
[
i
]
->
psz_value
);
REMOVE_ELEM
(
p_sdp
->
pp_attributes
,
p_sdp
->
i_attributes
,
i
);
FREE
(
p_attr
);
}
free
(
p_sdp
);
}
static
int
RemoveAnnounce
(
services_discovery_t
*
p_sd
,
sap_announce_t
*
p_announce
)
static
int
RemoveAnnounce
(
services_discovery_t
*
p_sd
,
sap_announce_t
*
p_announce
)
{
msg_Err
(
p_sd
,
"remove not implemented"
);
playlist_t
*
p_playlist
=
(
playlist_t
*
)
vlc_object_find
(
p_sd
,
VLC_OBJECT_PLAYLIST
,
FIND_ANYWHERE
);
if
(
p_announce
->
p_sdp
)
{
FreeSDP
(
p_announce
->
p_sdp
);
}
if
(
!
p_playlist
)
{
return
VLC_EGENERIC
;
}
if
(
p_announce
->
p_item
)
{
playlist_Delete
(
p_playlist
,
p_announce
->
p_item
->
input
.
i_id
);
}
vlc_object_release
(
p_playlist
);
free
(
p_announce
);
return
VLC_SUCCESS
;
}
...
...
@@ -1179,6 +1213,7 @@ static void CacheLoad( services_discovery_t *p_sd )
{
msg_Warn
(
p_sd
,
"Cache not implemented"
)
;
}
static
void
CacheSave
(
services_discovery_t
*
p_sd
)
{
msg_Warn
(
p_sd
,
"Cache not implemented"
)
;
...
...
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