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
0e3ef9ca
Commit
0e3ef9ca
authored
Jul 18, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use float for pf_volume_set volume
parent
ce90ea7f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
22 deletions
+16
-22
include/vlc_aout.h
include/vlc_aout.h
+1
-1
modules/audio_output/amem.c
modules/audio_output/amem.c
+2
-4
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+2
-3
modules/audio_output/waveout.c
modules/audio_output/waveout.c
+5
-7
src/audio_output/intf.c
src/audio_output/intf.c
+6
-7
No files found.
include/vlc_aout.h
View file @
0e3ef9ca
...
...
@@ -184,7 +184,7 @@ typedef struct aout_output_t
struct
aout_sys_t
*
p_sys
;
void
(
*
pf_play
)(
aout_instance_t
*
);
void
(
*
pf_pause
)(
aout_instance_t
*
,
bool
,
mtime_t
);
int
(
*
pf_volume_set
)(
aout_instance_t
*
,
audio_volume_
t
,
bool
);
int
(
*
pf_volume_set
)(
aout_instance_t
*
,
floa
t
,
bool
);
int
i_nb_samples
;
}
aout_output_t
;
...
...
modules/audio_output/amem.c
View file @
0e3ef9ca
...
...
@@ -25,7 +25,6 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
...
...
@@ -73,12 +72,11 @@ static void Play (aout_instance_t *aout)
}
}
static
int
VolumeSet
(
aout_instance_t
*
aout
,
audio_volume_t
i
vol
,
bool
mute
)
static
int
VolumeSet
(
aout_instance_t
*
aout
,
float
vol
,
bool
mute
)
{
aout_sys_t
*
sys
=
aout
->
output
.
p_sys
;
float
fvol
=
ivol
/
(
float
)
AOUT_VOLUME_DEFAULT
;
return
sys
->
set_volume
(
sys
->
opaque
,
f
vol
,
mute
)
?
-
1
:
0
;
return
sys
->
set_volume
(
sys
->
opaque
,
vol
,
mute
)
?
-
1
:
0
;
}
typedef
int
(
*
vlc_audio_format_cb
)
(
void
**
,
char
*
,
unsigned
*
,
unsigned
*
);
...
...
modules/audio_output/pulse.c
View file @
0e3ef9ca
...
...
@@ -28,7 +28,6 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_cpu.h>
#include <pulse/pulseaudio.h>
...
...
@@ -317,13 +316,13 @@ static void Pause(aout_instance_t *aout, bool b_paused, mtime_t i_date)
(
void
)
i_date
;
}
static
int
VolumeSet
(
aout_instance_t
*
aout
,
audio_volume_
t
vol
,
bool
mute
)
static
int
VolumeSet
(
aout_instance_t
*
aout
,
floa
t
vol
,
bool
mute
)
{
aout_sys_t
*
sys
=
aout
->
output
.
p_sys
;
pa_operation
*
op
;
uint32_t
idx
=
pa_stream_get_index
(
sys
->
stream
);
pa_volume_t
volume
=
pa_sw_volume_from_linear
(
vol
/
(
float
)
AOUT_VOLUME_DEFAULT
);
pa_volume_t
volume
=
pa_sw_volume_from_linear
(
vol
);
pa_cvolume
cvolume
;
/* TODO: do not ruin the channel balance (if set outside VLC) */
...
...
modules/audio_output/waveout.c
View file @
0e3ef9ca
...
...
@@ -33,7 +33,6 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_aout_intf.h>
#include <vlc_charset.h>
/* FromLocaleDup, LocaleFree */
#include <vlc_atomic.h>
...
...
@@ -63,7 +62,7 @@ static int PlayWaveOut ( aout_instance_t *, HWAVEOUT, WAVEHDR *,
static
void
CALLBACK
WaveOutCallback
(
HWAVEOUT
,
UINT
,
DWORD
,
DWORD
,
DWORD
);
static
void
*
WaveOutThread
(
void
*
);
static
int
VolumeSet
(
aout_instance_t
*
,
audio_volume_
t
,
bool
);
static
int
VolumeSet
(
aout_instance_t
*
,
floa
t
,
bool
);
static
int
WaveOutClearDoneBuffers
(
aout_sys_t
*
p_sys
);
...
...
@@ -999,14 +998,13 @@ static void* WaveOutThread( void *data )
return
NULL
;
}
static
int
VolumeSet
(
aout_instance_t
*
p_aout
,
audio_volume_t
i_volume
,
bool
mute
)
static
int
VolumeSet
(
aout_instance_t
*
p_aout
,
float
volume
,
bool
mute
)
{
if
(
mute
)
i_volume
=
AOUT_VOLUME_MIN
;
volume
=
0
.
;
unsigned
long
i_waveout_vol
=
i_volume
*
0xFFFF
*
2
/
AOUT_VOLUME_MAX
;
i_waveout_vol
|=
(
i_waveout_vol
<<
16
);
unsigned
long
i_waveout_vol
=
volume
*
0x7FFF
;
i_waveout_vol
=
(
i_waveout_vol
<<
16
)
|
(
i_waveout_vol
&
0xFFFF
);
#ifdef UNDER_CE
waveOutSetVolume
(
0
,
i_waveout_vol
);
...
...
src/audio_output/intf.c
View file @
0e3ef9ca
...
...
@@ -86,10 +86,12 @@ static int commitVolume (vlc_object_t *obj, aout_instance_t *aout,
if
(
aout
!=
NULL
)
{
float
vol
=
volume
/
(
float
)
AOUT_VOLUME_DEFAULT
;
aout_lock
(
aout
);
#warning FIXME: wrong test. Need to check that aout_output is ready.
if
(
aout
->
p_mixer
!=
NULL
)
ret
=
aout
->
output
.
pf_volume_set
(
aout
,
vol
ume
,
mute
);
ret
=
aout
->
output
.
pf_volume_set
(
aout
,
vol
,
mute
);
aout_unlock
(
aout
);
if
(
ret
==
0
)
...
...
@@ -241,11 +243,9 @@ int aout_SetMute (vlc_object_t *obj, audio_volume_t *volp, bool mute)
* The next functions are not supposed to be called by the interface, but
* are placeholders for software-only scaling.
*/
static
int
aout_VolumeSoftSet
(
aout_instance_t
*
aout
,
audio_volume_t
volume
,
bool
mute
)
static
int
aout_VolumeSoftSet
(
aout_instance_t
*
aout
,
float
volume
,
bool
mute
)
{
float
f
=
mute
?
0
.
:
(
volume
/
(
float
)
AOUT_VOLUME_DEFAULT
);
aout
->
mixer_multiplier
=
f
;
aout
->
mixer_multiplier
=
mute
?
0
.
:
volume
;
return
0
;
}
...
...
@@ -264,8 +264,7 @@ void aout_VolumeSoftInit (aout_instance_t *aout)
* The next functions are not supposed to be called by the interface, but
* are placeholders for unsupported scaling.
*/
static
int
aout_VolumeNoneSet
(
aout_instance_t
*
aout
,
audio_volume_t
volume
,
bool
mute
)
static
int
aout_VolumeNoneSet
(
aout_instance_t
*
aout
,
float
volume
,
bool
mute
)
{
(
void
)
aout
;
(
void
)
volume
;
(
void
)
mute
;
return
-
1
;
...
...
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