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
059529ab
Commit
059529ab
authored
May 01, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: smooth: fix memleaks
parent
839d1730
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
24 deletions
+25
-24
modules/stream_filter/smooth/smooth.c
modules/stream_filter/smooth/smooth.c
+25
-24
No files found.
modules/stream_filter/smooth/smooth.c
View file @
059529ab
...
...
@@ -404,6 +404,26 @@ static int parse_Manifest( stream_t *s )
return
VLC_SUCCESS
;
}
static
void
SysCleanup
(
stream_sys_t
*
p_sys
)
{
if
(
p_sys
->
sms_streams
)
{
for
(
int
i
=
0
;
i
<
p_sys
->
sms_streams
->
i_count
;
i
++
)
sms_Free
(
p_sys
->
sms_streams
->
pp_elems
[
i
]
);
vlc_array_destroy
(
p_sys
->
sms_streams
);
}
vlc_array_destroy
(
p_sys
->
selected_st
);
vlc_array_destroy
(
p_sys
->
download
.
chunks
);
if
(
p_sys
->
init_chunks
)
{
for
(
int
i
=
0
;
i
<
p_sys
->
init_chunks
->
i_count
;
i
++
)
chunk_Free
(
p_sys
->
init_chunks
->
pp_elems
[
i
]
);
vlc_array_destroy
(
p_sys
->
init_chunks
);
}
sms_queue_free
(
p_sys
->
bws
);
free
(
p_sys
->
base_url
);
}
static
int
Open
(
vlc_object_t
*
p_this
)
{
stream_t
*
s
=
(
stream_t
*
)
p_this
;
...
...
@@ -440,6 +460,7 @@ static int Open( vlc_object_t *p_this )
if
(
unlikely
(
!
p_sys
->
sms_streams
||
!
p_sys
->
download
.
chunks
||
!
p_sys
->
selected_st
||
!
p_sys
->
init_chunks
)
)
{
SysCleanup
(
p_sys
);
free
(
p_sys
);
return
VLC_ENOMEM
;
}
...
...
@@ -447,6 +468,7 @@ static int Open( vlc_object_t *p_this )
/* Parse SMS ismc content. */
if
(
parse_Manifest
(
s
)
!=
VLC_SUCCESS
)
{
SysCleanup
(
p_sys
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -497,9 +519,10 @@ static int Open( vlc_object_t *p_this )
if
(
vlc_clone
(
&
p_sys
->
thread
,
sms_Thread
,
s
,
VLC_THREAD_PRIORITY_INPUT
)
)
{
free
(
p_sys
);
SysCleanup
(
p_sys
);
vlc_mutex_destroy
(
&
p_sys
->
download
.
lock_wait
);
vlc_cond_destroy
(
&
p_sys
->
download
.
wait
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
...
...
@@ -524,29 +547,7 @@ static void Close( vlc_object_t *p_this )
vlc_mutex_destroy
(
&
p_sys
->
download
.
lock_wait
);
vlc_cond_destroy
(
&
p_sys
->
download
.
wait
);
/* Free sms streams */
sms_stream_t
*
sms
;
for
(
int
i
=
0
;
i
<
vlc_array_count
(
p_sys
->
sms_streams
);
i
++
)
{
sms
=
vlc_array_item_at_index
(
p_sys
->
sms_streams
,
i
);
if
(
sms
)
sms_Free
(
sms
);
}
/* Free downloaded chunks */
chunk_t
*
chunk
;
for
(
int
i
=
0
;
i
<
vlc_array_count
(
p_sys
->
init_chunks
);
i
++
)
{
chunk
=
vlc_array_item_at_index
(
p_sys
->
init_chunks
,
i
);
chunk_Free
(
chunk
);
}
sms_queue_free
(
p_sys
->
bws
);
vlc_array_destroy
(
p_sys
->
sms_streams
);
vlc_array_destroy
(
p_sys
->
selected_st
);
vlc_array_destroy
(
p_sys
->
download
.
chunks
);
vlc_array_destroy
(
p_sys
->
init_chunks
);
free
(
p_sys
->
base_url
);
SysCleanup
(
p_sys
);
free
(
p_sys
);
}
...
...
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