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
0929da45
Commit
0929da45
authored
May 22, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
equalizer: clean up bands callback and handle invalid/incomplete input
parent
97a13b8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
modules/audio_filter/equalizer.c
modules/audio_filter/equalizer.c
+11
-15
No files found.
modules/audio_filter/equalizer.c
View file @
0929da45
...
@@ -536,31 +536,27 @@ static int BandsCallback( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -536,31 +536,27 @@ static int BandsCallback( vlc_object_t *p_this, char const *psz_cmd,
{
{
VLC_UNUSED
(
p_this
);
VLC_UNUSED
(
psz_cmd
);
VLC_UNUSED
(
oldval
);
VLC_UNUSED
(
p_this
);
VLC_UNUSED
(
psz_cmd
);
VLC_UNUSED
(
oldval
);
filter_sys_t
*
p_sys
=
p_data
;
filter_sys_t
*
p_sys
=
p_data
;
const
char
*
psz_bands
=
newval
.
psz_string
;
const
char
*
p
=
newval
.
psz_string
;
const
char
*
p
=
psz_bands
;
int
i
=
0
;
char
*
psz_next
;
/* Same thing for bands */
/* Same thing for bands */
vlc_mutex_lock
(
&
p_sys
->
lock
);
vlc_mutex_lock
(
&
p_sys
->
lock
);
for
(
int
i
=
0
;
i
<
p_sys
->
i_band
;
i
++
)
while
(
i
<
p_sys
->
i_band
)
{
{
float
f
;
char
*
next
;
if
(
*
psz_bands
==
'\0'
)
break
;
/* Read dB -20/20 */
/* Read dB -20/20 */
f
=
us_strtof
(
p
,
&
psz_next
);
float
f
=
us_strtof
(
p
,
&
next
);
if
(
next
==
p
||
isnan
(
f
)
)
if
(
psz_next
==
p
)
break
;
/* no conversion */
break
;
/* no conversion */
p_sys
->
f_amp
[
i
]
=
EqzConvertdB
(
f
);
p_sys
->
f_amp
[
i
++
]
=
EqzConvertdB
(
f
);
if
(
*
psz_
next
==
'\0'
)
if
(
*
next
==
'\0'
)
break
;
/* end of line */
break
;
/* end of line */
p
=
&
psz_
next
[
1
];
p
=
&
next
[
1
];
}
}
while
(
i
<
p_sys
->
i_band
)
p_sys
->
f_amp
[
i
++
]
=
EqzConvertdB
(
0
.
f
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
vlc_mutex_unlock
(
&
p_sys
->
lock
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
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