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
71276f2b
Commit
71276f2b
authored
May 21, 2012
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lua: fix equalizer setting code
parent
ff5e8812
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
16 deletions
+25
-16
modules/lua/libs/equalizer.c
modules/lua/libs/equalizer.c
+25
-16
No files found.
modules/lua/libs/equalizer.c
View file @
71276f2b
...
@@ -206,7 +206,6 @@ static int vlclua_equalizer_set( lua_State *L )
...
@@ -206,7 +206,6 @@ static int vlclua_equalizer_set( lua_State *L )
if
(
!
p_input
)
if
(
!
p_input
)
return
0
;
return
0
;
int
i_pos
=
0
,
j
=
0
;
audio_output_t
*
p_aout
=
input_GetAout
(
p_input
);
audio_output_t
*
p_aout
=
input_GetAout
(
p_input
);
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
if
(
!
p_aout
)
if
(
!
p_aout
)
...
@@ -223,26 +222,36 @@ static int vlclua_equalizer_set( lua_State *L )
...
@@ -223,26 +222,36 @@ static int vlclua_equalizer_set( lua_State *L )
float
level
=
luaL_checknumber
(
L
,
2
);
float
level
=
luaL_checknumber
(
L
,
2
);
char
*
bands
=
var_GetString
(
p_aout
,
"equalizer-bands"
);
char
*
bands
=
var_GetString
(
p_aout
,
"equalizer-bands"
);
char
newstr
[
7
];
while
(
j
!=
bandid
)
locale_t
loc
=
newlocale
(
LC_NUMERIC_MASK
,
"C"
,
NULL
);
locale_t
oldloc
=
uselocale
(
loc
);
char
*
b
=
bands
;
while
(
bandid
>
0
)
{
{
i_pos
++
;
float
dummy
=
strtof
(
b
,
&
b
);
if
(
bands
[
i_pos
]
==
'.'
)
(
void
)
dummy
;
{
bandid
--
;
i_pos
++
;
}
j
++
;
if
(
*
b
!=
'\0'
)
}
*
b
++
=
'\0'
;
float
dummy
=
strtof
(
b
,
&
b
);
(
void
)
dummy
;
char
*
newstr
;
if
(
asprintf
(
&
newstr
,
"%s %.1f%s"
,
bands
,
level
,
b
)
!=
-
1
)
{
var_SetString
(
p_aout
,
"equalizer-bands"
,
newstr
);
free
(
newstr
);
}
}
if
(
bandid
!=
0
)
i_pos
++
;
snprintf
(
newstr
,
sizeof
(
newstr
)
,
"%6.1f"
,
level
);
for
(
int
i
=
0
;
i
<
6
;
i
++
)
bands
[
i_pos
+
i
]
=
newstr
[
i
];
var_SetString
(
p_aout
,
"equalizer-bands"
,
bands
);
if
(
loc
!=
(
locale_t
)
0
)
{
uselocale
(
oldloc
);
freelocale
(
loc
);
}
free
(
bands
);
free
(
bands
);
vlc_object_release
(
p_aout
);
vlc_object_release
(
p_aout
);
return
1
;
return
0
;
}
}
/*****************************************************************************
/*****************************************************************************
...
...
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