Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
bc727d2d
Commit
bc727d2d
authored
Aug 20, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix potential memleaks and remove stupid tests.
parent
2c28bcba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
32 deletions
+21
-32
modules/audio_filter/channel_mixer/headphone.c
modules/audio_filter/channel_mixer/headphone.c
+12
-25
modules/audio_filter/channel_mixer/mono.c
modules/audio_filter/channel_mixer/mono.c
+9
-7
No files found.
modules/audio_filter/channel_mixer/headphone.c
View file @
bc727d2d
...
@@ -218,12 +218,6 @@ static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
...
@@ -218,12 +218,6 @@ static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
int
i_source_channel_offset
;
int
i_source_channel_offset
;
unsigned
int
i
;
unsigned
int
i
;
if
(
p_data
==
NULL
)
{
msg_Dbg
(
p_this
,
"passing a null pointer as argument"
);
return
0
;
}
if
(
config_GetInt
(
p_this
,
"headphone-compensate"
)
)
if
(
config_GetInt
(
p_this
,
"headphone-compensate"
)
)
{
{
/* minimal distance to any speaker */
/* minimal distance to any speaker */
...
@@ -343,11 +337,13 @@ static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
...
@@ -343,11 +337,13 @@ static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
}
}
}
}
p_data
->
p_overflow_buffer
=
malloc
(
p_data
->
i_overflow_buffer_size
);
p_data
->
p_overflow_buffer
=
malloc
(
p_data
->
i_overflow_buffer_size
);
if
(
p_data
->
p_atomic_operations
==
NULL
)
if
(
p_data
->
p_overflow_buffer
==
NULL
)
{
free
(
p_data
->
p_atomic_operations
);
return
-
1
;
return
-
1
;
}
memset
(
p_data
->
p_overflow_buffer
,
0
,
p_data
->
i_overflow_buffer_size
);
memset
(
p_data
->
p_overflow_buffer
,
0
,
p_data
->
i_overflow_buffer_size
);
/* end */
return
0
;
return
0
;
}
}
...
@@ -397,7 +393,8 @@ static int Create( vlc_object_t *p_this )
...
@@ -397,7 +393,8 @@ static int Create( vlc_object_t *p_this )
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
;
AOUT_CHAN_REARRIGHT
;
}
}
if
(
!
b_fit
)
if
(
!
b_fit
)
{
{
msg_Dbg
(
p_filter
,
"requesting specific format"
);
msg_Dbg
(
p_filter
,
"requesting specific format"
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
...
@@ -417,6 +414,7 @@ static int Create( vlc_object_t *p_this )
...
@@ -417,6 +414,7 @@ static int Create( vlc_object_t *p_this )
,
p_filter
->
input
.
i_physical_channels
,
p_filter
->
input
.
i_physical_channels
,
p_filter
->
input
.
i_rate
)
<
0
)
,
p_filter
->
input
.
i_rate
)
<
0
)
{
{
free
(
p_filter
->
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -435,14 +433,8 @@ static void Destroy( vlc_object_t *p_this )
...
@@ -435,14 +433,8 @@ static void Destroy( vlc_object_t *p_this )
if
(
p_filter
->
p_sys
!=
NULL
)
if
(
p_filter
->
p_sys
!=
NULL
)
{
{
if
(
p_filter
->
p_sys
->
p_overflow_buffer
!=
NULL
)
free
(
p_filter
->
p_sys
->
p_overflow_buffer
);
{
free
(
p_filter
->
p_sys
->
p_atomic_operations
);
free
(
p_filter
->
p_sys
->
p_overflow_buffer
);
}
if
(
p_filter
->
p_sys
->
p_atomic_operations
!=
NULL
)
{
free
(
p_filter
->
p_sys
->
p_atomic_operations
);
}
free
(
p_filter
->
p_sys
);
free
(
p_filter
->
p_sys
);
p_filter
->
p_sys
=
NULL
;
p_filter
->
p_sys
=
NULL
;
}
}
...
@@ -629,6 +621,7 @@ static int OpenFilter( vlc_object_t *p_this )
...
@@ -629,6 +621,7 @@ static int OpenFilter( vlc_object_t *p_this )
,
p_filter
->
fmt_in
.
audio
.
i_physical_channels
,
p_filter
->
fmt_in
.
audio
.
i_physical_channels
,
p_filter
->
fmt_in
.
audio
.
i_rate
)
<
0
)
,
p_filter
->
fmt_in
.
audio
.
i_rate
)
<
0
)
{
{
free
(
p_filter
->
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -647,14 +640,8 @@ static void CloseFilter( vlc_object_t *p_this )
...
@@ -647,14 +640,8 @@ static void CloseFilter( vlc_object_t *p_this )
if
(
p_filter
->
p_sys
!=
NULL
)
if
(
p_filter
->
p_sys
!=
NULL
)
{
{
if
(
p_filter
->
p_sys
->
p_overflow_buffer
!=
NULL
)
free
(
p_filter
->
p_sys
->
p_overflow_buffer
);
{
free
(
p_filter
->
p_sys
->
p_atomic_operations
);
free
(
p_filter
->
p_sys
->
p_overflow_buffer
);
}
if
(
p_filter
->
p_sys
->
p_atomic_operations
!=
NULL
)
{
free
(
p_filter
->
p_sys
->
p_atomic_operations
);
}
free
(
p_filter
->
p_sys
);
free
(
p_filter
->
p_sys
);
p_filter
->
p_sys
=
NULL
;
p_filter
->
p_sys
=
NULL
;
}
}
...
...
modules/audio_filter/channel_mixer/mono.c
View file @
bc727d2d
...
@@ -219,12 +219,6 @@ static int Init( vlc_object_t *p_this, struct filter_sys_t * p_data,
...
@@ -219,12 +219,6 @@ static int Init( vlc_object_t *p_this, struct filter_sys_t * p_data,
int
i_source_channel_offset
;
int
i_source_channel_offset
;
unsigned
int
i
;
unsigned
int
i
;
if
(
p_data
==
NULL
)
{
msg_Dbg
(
p_this
,
"passing a null pointer as argument"
);
return
0
;
}
if
(
config_GetInt
(
p_this
,
"headphone-compensate"
)
)
if
(
config_GetInt
(
p_this
,
"headphone-compensate"
)
)
{
{
/* minimal distance to any speaker */
/* minimal distance to any speaker */
...
@@ -344,8 +338,11 @@ static int Init( vlc_object_t *p_this, struct filter_sys_t * p_data,
...
@@ -344,8 +338,11 @@ static int Init( vlc_object_t *p_this, struct filter_sys_t * p_data,
}
}
}
}
p_data
->
p_overflow_buffer
=
malloc
(
p_data
->
i_overflow_buffer_size
);
p_data
->
p_overflow_buffer
=
malloc
(
p_data
->
i_overflow_buffer_size
);
if
(
p_data
->
p_atomic_operations
==
NULL
)
if
(
p_data
->
p_overflow_buffer
==
NULL
)
{
free
(
p_data
->
p_atomic_operations
);
return
-
1
;
return
-
1
;
}
memset
(
p_data
->
p_overflow_buffer
,
0
,
p_data
->
i_overflow_buffer_size
);
memset
(
p_data
->
p_overflow_buffer
,
0
,
p_data
->
i_overflow_buffer_size
);
/* end */
/* end */
...
@@ -428,6 +425,9 @@ static int OpenFilter( vlc_object_t *p_this )
...
@@ -428,6 +425,9 @@ static int OpenFilter( vlc_object_t *p_this )
p_filter
->
fmt_in
.
audio
.
i_physical_channels
,
p_filter
->
fmt_in
.
audio
.
i_physical_channels
,
p_filter
->
fmt_in
.
audio
.
i_rate
)
<
0
)
p_filter
->
fmt_in
.
audio
.
i_rate
)
<
0
)
{
{
var_Destroy
(
p_this
,
MONO_CFG
"channel"
);
var_Destroy
(
p_this
,
MONO_CFG
"downmix"
);
free
(
p_sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -454,6 +454,8 @@ static void CloseFilter( vlc_object_t *p_this)
...
@@ -454,6 +454,8 @@ static void CloseFilter( vlc_object_t *p_this)
var_Destroy
(
p_this
,
MONO_CFG
"channel"
);
var_Destroy
(
p_this
,
MONO_CFG
"channel"
);
var_Destroy
(
p_this
,
MONO_CFG
"downmix"
);
var_Destroy
(
p_this
,
MONO_CFG
"downmix"
);
free
(
p_sys
->
p_atomic_operations
);
free
(
p_sys
->
p_overflow_buffer
);
free
(
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