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
1387f38f
Commit
1387f38f
authored
May 06, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: add option to initialize hardware volume
parent
9df888d6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
10 deletions
+14
-10
include/vlc_aout.h
include/vlc_aout.h
+1
-1
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+1
-6
modules/audio_output/pulse.c
modules/audio_output/pulse.c
+1
-1
modules/audio_output/waveout.c
modules/audio_output/waveout.c
+1
-1
src/audio_output/output.c
src/audio_output/output.c
+10
-1
No files found.
include/vlc_aout.h
View file @
1387f38f
...
...
@@ -221,7 +221,7 @@ VLC_API const char * aout_FormatPrintChannels( const audio_sample_format_t * ) V
VLC_API
void
aout_VolumeNoneInit
(
audio_output_t
*
);
VLC_API
void
aout_VolumeSoftInit
(
audio_output_t
*
);
VLC_API
void
aout_VolumeHardInit
(
audio_output_t
*
,
aout_volume_cb
);
VLC_API
void
aout_VolumeHardInit
(
audio_output_t
*
,
aout_volume_cb
,
bool
);
VLC_API
void
aout_VolumeHardSet
(
audio_output_t
*
,
float
,
bool
);
VLC_API
void
aout_TimeReport
(
audio_output_t
*
,
mtime_t
);
...
...
modules/audio_output/auhal.c
View file @
1387f38f
...
...
@@ -560,12 +560,7 @@ static int OpenAnalog( audio_output_t *p_aout )
/* Do the last VLC aout setups */
aout_FormatPrepare
(
&
p_aout
->
format
);
aout_PacketInit
(
p_aout
,
&
p_sys
->
packet
,
FRAMESIZE
);
aout_VolumeHardInit
(
p_aout
,
VolumeSet
);
/* Initialize starting volume */
audio_volume_t
volume
=
var_InheritInteger
(
p_aout
,
"volume"
);
bool
mute
=
var_InheritBool
(
p_aout
,
"mute"
);
VolumeSet
(
p_aout
,
volume
/
(
float
)
AOUT_VOLUME_DEFAULT
,
mute
);
aout_VolumeHardInit
(
p_aout
,
VolumeSet
,
true
);
/* set the IOproc callback */
input
.
inputProc
=
(
AURenderCallback
)
RenderCallbackAnalog
;
...
...
modules/audio_output/pulse.c
View file @
1387f38f
...
...
@@ -947,7 +947,7 @@ static int Open(vlc_object_t *obj)
aout
->
pf_play
=
Play
;
aout
->
pf_pause
=
Pause
;
aout
->
pf_flush
=
Flush
;
aout_VolumeHardInit
(
aout
,
VolumeSet
);
aout_VolumeHardInit
(
aout
,
VolumeSet
,
false
);
return
VLC_SUCCESS
;
fail:
...
...
modules/audio_output/waveout.c
View file @
1387f38f
...
...
@@ -296,7 +296,7 @@ static int Open( vlc_object_t *p_this )
if
(
waveOutGetDevCaps
(
(
UINT_PTR
)
p_aout
->
sys
->
h_waveout
,
&
wocaps
,
sizeof
(
wocaps
)
)
==
MMSYSERR_NOERROR
&&
(
wocaps
.
dwSupport
&
WAVECAPS_VOLUME
)
)
aout_VolumeHardInit
(
p_aout
,
VolumeSet
);
aout_VolumeHardInit
(
p_aout
,
VolumeSet
,
false
/* ?? */
);
else
aout_VolumeSoftInit
(
p_aout
);
}
...
...
src/audio_output/output.c
View file @
1387f38f
...
...
@@ -334,13 +334,22 @@ void aout_VolumeSoftInit (audio_output_t *aout)
* Configures a custom volume setter. This is used by audio outputs that can
* control the hardware volume directly and/or emulate it internally.
* @param setter volume setter callback
* @param restore apply volume from VLC configuration immediately
*/
void
aout_VolumeHardInit
(
audio_output_t
*
aout
,
aout_volume_cb
setter
)
void
aout_VolumeHardInit
(
audio_output_t
*
aout
,
aout_volume_cb
setter
,
bool
restore
)
{
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_InheritInteger
(
aout
,
"volume"
)
/
(
float
)
AOUT_VOLUME_DEFAULT
;
setter
(
aout
,
vol
,
var_InheritBool
(
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