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
556f1a14
Commit
556f1a14
authored
Aug 09, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed duplicated code in audio intf.c
parent
7c6ef80c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
45 deletions
+19
-45
src/audio_output/intf.c
src/audio_output/intf.c
+19
-45
No files found.
src/audio_output/intf.c
View file @
556f1a14
...
...
@@ -154,33 +154,35 @@ int __aout_VolumeInfos( vlc_object_t * p_object, audio_volume_t * pi_soft )
int
__aout_VolumeUp
(
vlc_object_t
*
p_object
,
int
i_nb_steps
,
audio_volume_t
*
pi_volume
)
{
aout_instance_t
*
p_aout
=
vlc_object_find
(
p_object
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
int
i_result
=
0
,
i_volume
=
0
,
i_volume_step
=
0
;
i_volume_step
=
config_GetInt
(
p_object
->
p_libvlc
,
"volume-step"
);
i_volume
=
config_GetInt
(
p_object
,
"volume"
);
i_volume
+=
i_volume_step
*
i_nb_steps
;
const
int
i_volume_step
=
config_GetInt
(
p_object
->
p_libvlc
,
"volume-step"
);
int
i_volume
=
config_GetInt
(
p_object
,
"volume"
)
+
i_volume_step
*
i_nb_steps
;
if
(
i_volume
>
AOUT_VOLUME_MAX
)
{
i_volume
=
AOUT_VOLUME_MAX
;
}
else
if
(
i_volume
<
AOUT_VOLUME_MIN
)
i_volume
=
AOUT_VOLUME_MIN
;
config_PutInt
(
p_object
,
"volume"
,
i_volume
);
var_Create
(
p_object
->
p_libvlc
,
"saved-volume"
,
VLC_VAR_INTEGER
);
var_SetInteger
(
p_object
->
p_libvlc
,
"saved-volume"
,
(
audio_volume_t
)
i_volume
);
if
(
pi_volume
!=
NULL
)
*
pi_volume
=
(
audio_volume_t
)
i_volume
;
var_SetInteger
(
p_object
->
p_libvlc
,
"saved-volume"
,
i_volume
);
if
(
pi_volume
!=
NULL
)
*
pi_volume
=
i_volume
;
var_SetBool
(
p_object
->
p_libvlc
,
"volume-change"
,
true
);
if
(
p_aout
==
NULL
)
return
0
;
aout_instance_t
*
p_aout
=
vlc_object_find
(
p_object
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
if
(
p_aout
==
NULL
)
return
0
;
int
i_result
;
aout_lock_mixer
(
p_aout
);
if
(
!
p_aout
->
mixer
.
b_error
)
{
i_result
=
p_aout
->
output
.
pf_volume_set
(
p_aout
,
(
audio_volume_t
)
i_volume
);
}
i_result
=
p_aout
->
output
.
pf_volume_set
(
p_aout
,
i_volume
);
else
i_result
=
VLC_SUCCESS
;
aout_unlock_mixer
(
p_aout
);
vlc_object_release
(
p_aout
);
...
...
@@ -196,35 +198,7 @@ int __aout_VolumeUp( vlc_object_t * p_object, int i_nb_steps,
int
__aout_VolumeDown
(
vlc_object_t
*
p_object
,
int
i_nb_steps
,
audio_volume_t
*
pi_volume
)
{
aout_instance_t
*
p_aout
=
vlc_object_find
(
p_object
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
int
i_result
=
0
,
i_volume
=
0
,
i_volume_step
=
0
;
i_volume_step
=
config_GetInt
(
p_object
->
p_libvlc
,
"volume-step"
);
i_volume
=
config_GetInt
(
p_object
,
"volume"
);
i_volume
-=
i_volume_step
*
i_nb_steps
;
if
(
i_volume
<
AOUT_VOLUME_MIN
)
{
i_volume
=
AOUT_VOLUME_MIN
;
}
config_PutInt
(
p_object
,
"volume"
,
i_volume
);
var_Create
(
p_object
->
p_libvlc
,
"saved-volume"
,
VLC_VAR_INTEGER
);
var_SetInteger
(
p_object
->
p_libvlc
,
"saved-volume"
,
(
audio_volume_t
)
i_volume
);
if
(
pi_volume
!=
NULL
)
*
pi_volume
=
(
audio_volume_t
)
i_volume
;
var_SetBool
(
p_object
->
p_libvlc
,
"volume-change"
,
true
);
if
(
p_aout
==
NULL
)
return
0
;
aout_lock_mixer
(
p_aout
);
if
(
!
p_aout
->
mixer
.
b_error
)
{
i_result
=
p_aout
->
output
.
pf_volume_set
(
p_aout
,
(
audio_volume_t
)
i_volume
);
}
aout_unlock_mixer
(
p_aout
);
vlc_object_release
(
p_aout
);
return
i_result
;
return
__aout_VolumeUp
(
p_object
,
-
i_nb_steps
,
pi_volume
);
}
/*****************************************************************************
...
...
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