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
0e63a3fc
Commit
0e63a3fc
authored
May 24, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: enable/disable the equalizer as needed, simplify
parent
585c2bc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
31 deletions
+18
-31
lib/media_player.c
lib/media_player.c
+18
-31
No files found.
lib/media_player.c
View file @
0e63a3fc
...
...
@@ -469,6 +469,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
var_Create
(
mp
,
"mute"
,
VLC_VAR_BOOL
);
var_Create
(
mp
,
"volume"
,
VLC_VAR_FLOAT
);
var_Create
(
mp
,
"corks"
,
VLC_VAR_INTEGER
);
var_Create
(
mp
,
"audio-filter"
,
VLC_VAR_STRING
);
var_Create
(
mp
,
"amem-data"
,
VLC_VAR_ADDRESS
);
var_Create
(
mp
,
"amem-setup"
,
VLC_VAR_ADDRESS
);
var_Create
(
mp
,
"amem-cleanup"
,
VLC_VAR_ADDRESS
);
...
...
@@ -1472,49 +1473,35 @@ void libvlc_media_player_set_video_title_display( libvlc_media_player_t *p_mi, l
int
libvlc_media_player_set_equalizer
(
libvlc_media_player_t
*
p_mi
,
libvlc_equalizer_t
*
p_equalizer
)
{
float
f_preamp
;
char
*
psz_bands
;
char
bands
[
EQZ_BANDS_MAX
*
EQZ_BAND_VALUE_SIZE
+
1
];
if
(
p_equalizer
)
if
(
p_equalizer
!=
NULL
)
{
f_preamp
=
p_equalizer
->
f_preamp
;
psz_bands
=
malloc
(
EQZ_BANDS_MAX
*
EQZ_BAND_VALUE_SIZE
+
1
);
if
(
unlikely
(
psz_bands
==
NULL
)
)
return
-
1
;
char
*
p
=
psz_bands
;
int
c
;
for
(
int
i
=
0
;
i
<
EQZ_BANDS_MAX
;
i
++
)
for
(
unsigned
i
=
0
,
c
=
0
;
i
<
EQZ_BANDS_MAX
;
i
++
)
{
c
=
snprintf
(
p
,
EQZ_BAND_VALUE_SIZE
+
1
,
" %.07f"
,
p_equalizer
->
f_amp
[
i
]
);
if
(
unlikely
(
c
>=
EQZ_BAND_VALUE_SIZE
+
1
)
)
{
free
(
psz_bands
);
c
=
snprintf
(
bands
+
c
,
sizeof
(
bands
)
-
c
,
" %.07f"
,
p_equalizer
->
f_amp
[
i
]
);
if
(
unlikely
(
c
>=
sizeof
(
bands
))
)
return
-
1
;
}
p
+=
c
;
}
}
else
{
f_preamp
=
0
.
f
;
psz_bands
=
NULL
;
}
var_SetFloat
(
p_mi
,
"equalizer-preamp"
,
f_preamp
);
var_SetString
(
p_mi
,
"equalizer-bands"
,
psz_bands
);
var_SetFloat
(
p_mi
,
"equalizer-preamp"
,
p_equalizer
->
f_preamp
);
var_SetString
(
p_mi
,
"equalizer-bands"
,
bands
);
}
var_SetString
(
p_mi
,
"audio-filter"
,
p_equalizer
?
"equalizer"
:
""
);
audio_output_t
*
p_aout
=
input_resource_HoldAout
(
p_mi
->
input
.
p_resource
);
if
(
p_aout
)
if
(
p_aout
!=
NULL
)
{
var_SetFloat
(
p_aout
,
"equalizer-preamp"
,
f_preamp
);
var_SetString
(
p_aout
,
"equalizer-bands"
,
psz_bands
);
if
(
p_equalizer
!=
NULL
)
{
var_SetFloat
(
p_aout
,
"equalizer-preamp"
,
p_equalizer
->
f_preamp
);
var_SetString
(
p_aout
,
"equalizer-bands"
,
bands
);
}
var_SetString
(
p_mi
,
"audio-filter"
,
p_equalizer
?
"equalizer"
:
""
);
vlc_object_release
(
p_aout
);
}
free
(
psz_bands
);
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