Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
164c18c9
Commit
164c18c9
authored
Apr 07, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce volume min and max (small regression from previous commits)
parent
28ef0fe1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
src/audio_output/intf.c
src/audio_output/intf.c
+12
-5
No files found.
src/audio_output/intf.c
View file @
164c18c9
...
@@ -76,10 +76,17 @@ static void prepareVolume (vlc_object_t *obj, aout_instance_t **aoutp,
...
@@ -76,10 +76,17 @@ static void prepareVolume (vlc_object_t *obj, aout_instance_t **aoutp,
/** Commit a volume change transaction. */
/** Commit a volume change transaction. */
static
int
commitVolume
(
vlc_object_t
*
obj
,
aout_instance_t
*
aout
,
static
int
commitVolume
(
vlc_object_t
*
obj
,
aout_instance_t
*
aout
,
audio_volume_t
volume
,
bool
mute
)
audio_volume_t
*
volp
,
bool
mute
)
{
{
int
ret
=
0
;
int
ret
=
0
;
audio_volume_t
volume
=
*
volp
;
if
(
volume
<
AOUT_VOLUME_MIN
)
volume
=
AOUT_VOLUME_MIN
;
if
(
volume
>
AOUT_VOLUME_MAX
)
volume
=
AOUT_VOLUME_MAX
;
*
volp
=
volume
;
var_SetInteger
(
obj
,
"volume"
,
volume
);
var_SetInteger
(
obj
,
"volume"
,
volume
);
var_SetBool
(
obj
,
"mute"
,
mute
);
var_SetBool
(
obj
,
"mute"
,
mute
);
...
@@ -142,7 +149,7 @@ int aout_VolumeSet (vlc_object_t *obj, audio_volume_t volume)
...
@@ -142,7 +149,7 @@ int aout_VolumeSet (vlc_object_t *obj, audio_volume_t volume)
bool
mute
;
bool
mute
;
prepareVolume
(
obj
,
&
aout
,
NULL
,
&
mute
);
prepareVolume
(
obj
,
&
aout
,
NULL
,
&
mute
);
return
commitVolume
(
obj
,
aout
,
volume
,
mute
);
return
commitVolume
(
obj
,
aout
,
&
volume
,
mute
);
}
}
#undef aout_VolumeUp
#undef aout_VolumeUp
...
@@ -160,7 +167,7 @@ int aout_VolumeUp (vlc_object_t *obj, int steps, audio_volume_t *volp)
...
@@ -160,7 +167,7 @@ int aout_VolumeUp (vlc_object_t *obj, int steps, audio_volume_t *volp)
prepareVolume
(
obj
,
&
aout
,
&
volume
,
&
mute
);
prepareVolume
(
obj
,
&
aout
,
&
volume
,
&
mute
);
volume
+=
stepsize
*
steps
;
volume
+=
stepsize
*
steps
;
ret
=
commitVolume
(
obj
,
aout
,
volume
,
mute
);
ret
=
commitVolume
(
obj
,
aout
,
&
volume
,
mute
);
if
(
volp
!=
NULL
)
if
(
volp
!=
NULL
)
*
volp
=
volume
;
*
volp
=
volume
;
return
ret
;
return
ret
;
...
@@ -188,7 +195,7 @@ int aout_ToggleMute (vlc_object_t *obj, audio_volume_t *volp)
...
@@ -188,7 +195,7 @@ int aout_ToggleMute (vlc_object_t *obj, audio_volume_t *volp)
prepareVolume
(
obj
,
&
aout
,
&
volume
,
&
mute
);
prepareVolume
(
obj
,
&
aout
,
&
volume
,
&
mute
);
mute
=
!
mute
;
mute
=
!
mute
;
ret
=
commitVolume
(
obj
,
aout
,
volume
,
mute
);
ret
=
commitVolume
(
obj
,
aout
,
&
volume
,
mute
);
if
(
volp
!=
NULL
)
if
(
volp
!=
NULL
)
*
volp
=
mute
?
AOUT_VOLUME_MIN
:
volume
;
*
volp
=
mute
?
AOUT_VOLUME_MIN
:
volume
;
return
ret
;
return
ret
;
...
@@ -221,7 +228,7 @@ int aout_SetMute (vlc_object_t *obj, audio_volume_t *volp, bool mute)
...
@@ -221,7 +228,7 @@ int aout_SetMute (vlc_object_t *obj, audio_volume_t *volp, bool mute)
audio_volume_t
volume
;
audio_volume_t
volume
;
prepareVolume
(
obj
,
&
aout
,
&
volume
,
NULL
);
prepareVolume
(
obj
,
&
aout
,
&
volume
,
NULL
);
ret
=
commitVolume
(
obj
,
aout
,
volume
,
mute
);
ret
=
commitVolume
(
obj
,
aout
,
&
volume
,
mute
);
if
(
volp
!=
NULL
)
if
(
volp
!=
NULL
)
*
volp
=
mute
?
AOUT_VOLUME_MIN
:
volume
;
*
volp
=
mute
?
AOUT_VOLUME_MIN
:
volume
;
return
ret
;
return
ret
;
...
...
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