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
669ce09e
Commit
669ce09e
authored
May 21, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
waveout: correct scale
0xffff is full volume, which I understand to mean 0dB.
parent
0d847ccb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
modules/audio_output/waveout.c
modules/audio_output/waveout.c
+13
-13
No files found.
modules/audio_output/waveout.c
View file @
669ce09e
...
...
@@ -31,6 +31,7 @@
#endif
#include <stdio.h>
#include <math.h>
#include <wchar.h>
#define UNICODE
...
...
@@ -995,22 +996,21 @@ static void* WaveOutThread( void *data )
static
int
VolumeSet
(
audio_output_t
*
p_aout
,
float
volume
,
bool
mute
)
{
#ifndef UNDER_CE
const
HWAVEOUT
hwo
=
p_aout
->
sys
->
h_waveout
;
#else
const
HWAVEOUT
hwo
=
0
;
#endif
const
float
full
=
0xffff
.
fp0
;
if
(
mute
)
volume
=
0
.;
volume
*=
full
;
if
(
volume
>=
full
)
volume
=
full
;
unsigned
long
i_waveout_vol
=
volume
*
(
0xFFFF
*
AOUT_VOLUME_DEFAULT
/
AOUT_VOLUME_MAX
);
if
(
i_waveout_vol
<=
0xFFFF
)
i_waveout_vol
|=
i_waveout_vol
<<
16
;
else
i_waveout_vol
=
0xFFFFFFFF
;
#ifdef UNDER_CE
waveOutSetVolume
(
0
,
i_waveout_vol
);
#else
waveOutSetVolume
(
p_aout
->
sys
->
h_waveout
,
i_waveout_vol
);
#endif
uint16_t
vol
=
lroundf
(
volume
);
waveOutSetVolume
(
hwo
,
vol
|
(
vol
<<
16
)
);
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