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
6a40ca71
Commit
6a40ca71
authored
May 22, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: simplify volume and mute variables life cycle
parent
55545b45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
src/audio_output/common.c
src/audio_output/common.c
+2
-0
src/audio_output/output.c
src/audio_output/output.c
+4
-8
No files found.
src/audio_output/common.c
View file @
6a40ca71
...
...
@@ -75,6 +75,8 @@ audio_output_t *aout_New( vlc_object_t * p_parent )
vlc_value_t
val
,
text
;
char
*
str
;
var_Create
(
aout
,
"volume"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
aout
,
"mute"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Create
(
aout
,
"intf-change"
,
VLC_VAR_VOID
);
/* Visualizations */
...
...
src/audio_output/output.c
View file @
6a40ca71
...
...
@@ -286,8 +286,6 @@ void aout_VolumeNoneInit (audio_output_t *aout)
* other thread knows of this audio output instance.
aout_assert_locked (aout); */
aout
->
pf_volume_set
=
aout_VolumeNoneSet
;
var_Destroy
(
aout
,
"volume"
);
var_Destroy
(
aout
,
"mute"
);
}
/**
...
...
@@ -322,8 +320,8 @@ static int aout_VolumeSoftSet (audio_output_t *aout, float volume, bool mute)
*/
void
aout_VolumeSoftInit
(
audio_output_t
*
aout
)
{
audio_volume_t
volume
=
var_
Inheri
tInteger
(
aout
,
"volume"
);
bool
mute
=
var_
Inheri
tBool
(
aout
,
"mute"
);
audio_volume_t
volume
=
var_
Ge
tInteger
(
aout
,
"volume"
);
bool
mute
=
var_
Ge
tBool
(
aout
,
"mute"
);
aout_assert_locked
(
aout
);
aout
->
pf_volume_set
=
aout_VolumeSoftSet
;
...
...
@@ -341,14 +339,12 @@ void aout_VolumeHardInit (audio_output_t *aout, aout_volume_cb setter,
{
aout_assert_locked
(
aout
);
aout
->
pf_volume_set
=
setter
;
var_Create
(
aout
,
"volume"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Create
(
aout
,
"mute"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
if
(
restore
)
{
float
vol
=
var_
Inheri
tInteger
(
aout
,
"volume"
)
float
vol
=
var_
Ge
tInteger
(
aout
,
"volume"
)
/
(
float
)
AOUT_VOLUME_DEFAULT
;
setter
(
aout
,
vol
,
var_
Inheri
tBool
(
aout
,
"mute"
));
setter
(
aout
,
vol
,
var_
Ge
tBool
(
aout
,
"mute"
));
}
}
...
...
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