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
a6b0ee0b
Commit
a6b0ee0b
authored
Jan 21, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Equalizer: fix invalid sprintf() usage - fixes #2424
parent
c15dfbb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
36 deletions
+36
-36
modules/audio_filter/equalizer.c
modules/audio_filter/equalizer.c
+36
-36
No files found.
modules/audio_filter/equalizer.c
View file @
a6b0ee0b
...
@@ -505,52 +505,52 @@ static int PresetCallback( vlc_object_t *p_this, char const *psz_cmd,
...
@@ -505,52 +505,52 @@ static int PresetCallback( vlc_object_t *p_this, char const *psz_cmd,
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
p_this
;
aout_instance_t
*
p_aout
=
(
aout_instance_t
*
)
p_this
;
char
*
psz_preset
=
newval
.
psz_string
;
char
*
psz_preset
=
newval
.
psz_string
;
char
psz_newbands
[
120
];
memset
(
psz_newbands
,
0
,
120
);
if
(
!*
psz_preset
||
p_sys
->
i_band
!=
10
)
return
VLC_SUCCESS
;
if
(
*
psz_preset
&&
p_sys
->
i_band
==
10
)
for
(
unsigned
i
=
0
;
eqz_preset_10b
[
i
]
!=
NULL
;
i
++
)
{
{
int
i
;
if
(
!
strcasecmp
(
eqz_preset_10b
[
i
]
->
psz_name
,
psz_preset
)
)
/* */
for
(
i
=
0
;
eqz_preset_10b
[
i
]
!=
NULL
;
i
++
)
{
{
if
(
!
strcasecmp
(
eqz_preset_10b
[
i
]
->
psz_name
,
psz_preset
)
)
char
*
psz_newbands
=
NULL
;
p_sys
->
f_gamp
*=
pow
(
10
,
eqz_preset_10b
[
i
]
->
f_preamp
/
20
.
0
);
for
(
int
j
=
0
;
j
<
p_sys
->
i_band
;
j
++
)
{
{
int
j
;
lldiv_t
d
;
p_sys
->
f_gamp
*=
pow
(
10
,
eqz_preset_10b
[
i
]
->
f_preamp
/
20
.
0
);
char
*
psz
;
for
(
j
=
0
;
j
<
p_sys
->
i_band
;
j
++
)
{
p_sys
->
f_amp
[
j
]
=
EqzConvertdB
(
eqz_preset_10b
[
i
]
->
f_amp
[
j
]
);
lldiv_t
div
;
d
=
lldiv
(
eqz_preset_10b
[
i
]
->
f_amp
[
j
]
*
10000000
,
10000000
);
p_sys
->
f_amp
[
j
]
=
EqzConvertdB
(
if
(
asprintf
(
&
psz
,
"%s %lld.%07llu"
,
eqz_preset_10b
[
i
]
->
f_amp
[
j
]
);
psz_newbands
?
psz_newbands
:
""
,
div
=
lldiv
(
eqz_preset_10b
[
i
]
->
f_amp
[
j
]
*
10000000
,
d
.
quot
,
d
.
rem
)
==
-
1
)
10000000
);
sprintf
(
psz_newbands
,
"%s %"
PRId64
".%07u"
,
psz_newbands
,
(
int64_t
)
div
.
quot
,
(
unsigned
int
)
div
.
rem
);
}
if
(
p_sys
->
b_first
==
false
)
{
{
var_SetString
(
p_aout
,
"equalizer-bands"
,
psz_newbands
);
free
(
psz_newbands
);
var_SetFloat
(
p_aout
,
"equalizer-preamp"
,
return
VLC_ENOMEM
;
eqz_preset_10b
[
i
]
->
f_preamp
);
}
}
else
psz_newbands
=
psz
;
{
p_sys
->
psz_newbands
=
strdup
(
psz_newbands
);
p_sys
->
f_newpreamp
=
eqz_preset_10b
[
i
]
->
f_preamp
;
}
break
;
}
}
}
if
(
p_sys
->
b_first
==
false
)
if
(
eqz_preset_10b
[
i
]
==
NULL
)
{
{
var_SetString
(
p_aout
,
"equalizer-bands"
,
psz_newbands
);
msg_Err
(
p_aout
,
"equalizer preset '%s' not found"
,
psz_preset
);
var_SetFloat
(
p_aout
,
"equalizer-preamp"
,
msg_Dbg
(
p_aout
,
"full list:"
);
eqz_preset_10b
[
i
]
->
f_preamp
);
for
(
i
=
0
;
eqz_preset_10b
[
i
]
!=
NULL
;
i
++
)
free
(
psz_newbands
);
msg_Dbg
(
p_aout
,
" - '%s'"
,
eqz_preset_10b
[
i
]
->
psz_name
);
}
else
{
p_sys
->
psz_newbands
=
psz_newbands
;
p_sys
->
f_newpreamp
=
eqz_preset_10b
[
i
]
->
f_preamp
;
}
return
VLC_SUCCESS
;
}
}
}
}
msg_Err
(
p_aout
,
"equalizer preset '%s' not found"
,
psz_preset
);
msg_Info
(
p_aout
,
"full list:"
);
for
(
unsigned
i
=
0
;
eqz_preset_10b
[
i
]
!=
NULL
;
i
++
)
msg_Info
(
p_aout
,
" - '%s'"
,
eqz_preset_10b
[
i
]
->
psz_name
);
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