Commit 5960db9f authored by Gildas Bazin's avatar Gildas Bazin

modules/audio_output/waveout.c: backport of 13376.

parent 7ae23ab6
...@@ -250,6 +250,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -250,6 +250,8 @@ static int Open( vlc_object_t *p_this )
} }
else else
{ {
WAVEOUTCAPS wocaps;
if( val.i_int == AOUT_VAR_5_1 ) if( val.i_int == AOUT_VAR_5_1 )
{ {
p_aout->output.output.i_physical_channels p_aout->output.output.i_physical_channels
...@@ -292,9 +294,20 @@ static int Open( vlc_object_t *p_this ) ...@@ -292,9 +294,20 @@ static int Open( vlc_object_t *p_this )
aout_VolumeSoftInit( p_aout ); aout_VolumeSoftInit( p_aout );
p_aout->output.pf_volume_infos = VolumeInfos; /* Check for hardware volume support */
p_aout->output.pf_volume_get = VolumeGet; if( waveOutGetDevCaps( (UINT_PTR)p_aout->output.p_sys->h_waveout,
p_aout->output.pf_volume_set = VolumeSet; &wocaps, sizeof(wocaps) == MMSYSERR_NOERROR ) &&
wocaps.dwSupport == WAVECAPS_VOLUME )
{
DWORD i_dummy;
if( waveOutGetVolume( p_aout->output.p_sys->h_waveout, &i_dummy )
== MMSYSERR_NOERROR )
{
p_aout->output.pf_volume_infos = VolumeInfos;
p_aout->output.pf_volume_get = VolumeGet;
p_aout->output.pf_volume_set = VolumeSet;
}
}
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment