Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
94b3251f
Commit
94b3251f
authored
Jul 11, 2011
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua_equalizer: fix memory leaks
parent
2a8f1eb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
modules/lua/libs/equalizer.c
modules/lua/libs/equalizer.c
+12
-3
No files found.
modules/lua/libs/equalizer.c
View file @
94b3251f
...
@@ -70,9 +70,11 @@ static int vlclua_preamp_get( lua_State *L )
...
@@ -70,9 +70,11 @@ static int vlclua_preamp_get( lua_State *L )
char
*
psz_af
=
var_GetNonEmptyString
(
p_aout
,
"audio-filter"
);
char
*
psz_af
=
var_GetNonEmptyString
(
p_aout
,
"audio-filter"
);
if
(
strstr
(
psz_af
,
"equalizer"
)
==
NULL
)
if
(
strstr
(
psz_af
,
"equalizer"
)
==
NULL
)
{
{
free
(
psz_af
);
vlc_object_release
(
p_aout
);
vlc_object_release
(
p_aout
);
return
0
;
return
0
;
}
}
free
(
psz_af
);
lua_pushnumber
(
L
,
var_GetFloat
(
p_aout
,
"equalizer-preamp"
)
);
lua_pushnumber
(
L
,
var_GetFloat
(
p_aout
,
"equalizer-preamp"
)
);
vlc_object_release
(
p_aout
);
vlc_object_release
(
p_aout
);
...
@@ -97,9 +99,11 @@ static int vlclua_preamp_set( lua_State *L )
...
@@ -97,9 +99,11 @@ static int vlclua_preamp_set( lua_State *L )
char
*
psz_af
=
var_GetNonEmptyString
(
p_aout
,
"audio-filter"
);
char
*
psz_af
=
var_GetNonEmptyString
(
p_aout
,
"audio-filter"
);
if
(
strstr
(
psz_af
,
"equalizer"
)
==
NULL
)
if
(
strstr
(
psz_af
,
"equalizer"
)
==
NULL
)
{
{
free
(
psz_af
);
vlc_object_release
(
p_aout
);
vlc_object_release
(
p_aout
);
return
0
;
return
0
;
}
}
free
(
psz_af
);
var_SetFloat
(
p_aout
,
"equalizer-preamp"
,
luaL_checknumber
(
L
,
1
)
);
var_SetFloat
(
p_aout
,
"equalizer-preamp"
,
luaL_checknumber
(
L
,
1
)
);
vlc_object_release
(
p_aout
);
vlc_object_release
(
p_aout
);
...
@@ -138,26 +142,29 @@ static int vlclua_equalizer_get( lua_State *L )
...
@@ -138,26 +142,29 @@ static int vlclua_equalizer_get( lua_State *L )
char
*
psz_af
=
var_GetNonEmptyString
(
p_aout
,
"audio-filter"
);
char
*
psz_af
=
var_GetNonEmptyString
(
p_aout
,
"audio-filter"
);
if
(
strstr
(
psz_af
,
"equalizer"
)
==
NULL
)
if
(
strstr
(
psz_af
,
"equalizer"
)
==
NULL
)
{
{
free
(
psz_af
);
vlc_object_release
(
p_aout
);
vlc_object_release
(
p_aout
);
return
0
;
return
0
;
}
}
free
(
psz_af
);
int
bandid
=
luaL_checknumber
(
L
,
1
);
int
bandid
=
luaL_checknumber
(
L
,
1
);
char
*
bands
=
var_GetNonEmptyString
(
p_aout
,
"equalizer-bands"
);
char
*
psz_bands_origin
,
*
psz_bands
;
psz_bands_origin
=
psz_bands
=
var_GetNonEmptyString
(
p_aout
,
"equalizer-bands"
);
locale_t
loc
=
newlocale
(
LC_NUMERIC_MASK
,
"C"
,
NULL
);
locale_t
loc
=
newlocale
(
LC_NUMERIC_MASK
,
"C"
,
NULL
);
locale_t
oldloc
=
uselocale
(
loc
);
locale_t
oldloc
=
uselocale
(
loc
);
while
(
bandid
>=
0
)
while
(
bandid
>=
0
)
{
{
level
=
strtof
(
bands
,
&
bands
);
level
=
strtof
(
psz_bands
,
&
psz_
bands
);
bandid
--
;
bandid
--
;
}
}
free
(
psz_bands_origin
);
if
(
loc
!=
(
locale_t
)
0
)
if
(
loc
!=
(
locale_t
)
0
)
{
{
uselocale
(
oldloc
);
uselocale
(
oldloc
);
freelocale
(
loc
);
freelocale
(
loc
);
}
}
vlc_object_release
(
p_aout
);
vlc_object_release
(
p_aout
);
if
(
bandid
==
-
1
)
if
(
bandid
==
-
1
)
{
{
...
@@ -187,9 +194,11 @@ static int vlclua_equalizer_set( lua_State *L )
...
@@ -187,9 +194,11 @@ static int vlclua_equalizer_set( lua_State *L )
char
*
psz_af
=
var_GetNonEmptyString
(
p_aout
,
"audio-filter"
);
char
*
psz_af
=
var_GetNonEmptyString
(
p_aout
,
"audio-filter"
);
if
(
strstr
(
psz_af
,
"equalizer"
)
==
NULL
)
if
(
strstr
(
psz_af
,
"equalizer"
)
==
NULL
)
{
{
free
(
psz_af
);
vlc_object_release
(
p_aout
);
vlc_object_release
(
p_aout
);
return
0
;
return
0
;
}
}
free
(
psz_af
);
int
bandid
=
luaL_checknumber
(
L
,
1
);
int
bandid
=
luaL_checknumber
(
L
,
1
);
float
level
=
luaL_checknumber
(
L
,
2
);
float
level
=
luaL_checknumber
(
L
,
2
);
...
...
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