[vlc-commits] waveout: fix volume initialization

Rémi Denis-Courmont git at videolan.org
Sun May 6 14:39:07 CEST 2012


vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May  6 15:38:12 2012 +0300| [2cc0e83d2b742b0ddbc1c058e510cdce4b02dbd9] | committer: Rémi Denis-Courmont

waveout: fix volume initialization

(cherry picked from commit 9be0932d795076e8b33cfabb4a2d23042826025d)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=2cc0e83d2b742b0ddbc1c058e510cdce4b02dbd9
---

 modules/audio_output/waveout.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/modules/audio_output/waveout.c b/modules/audio_output/waveout.c
index f5a1975..ba4c66f 100644
--- a/modules/audio_output/waveout.c
+++ b/modules/audio_output/waveout.c
@@ -287,20 +287,14 @@ static int Open( vlc_object_t *p_this )
             p_aout->format.i_bytes_per_frame;
 
         aout_PacketInit( p_aout, &p_aout->sys->packet, FRAME_SIZE );
-        aout_VolumeSoftInit( p_aout );
 
         /* Check for hardware volume support */
         if( waveOutGetDevCaps( (UINT_PTR)p_aout->sys->h_waveout,
-                               &wocaps, sizeof(wocaps) ) == MMSYSERR_NOERROR &&
-            wocaps.dwSupport & WAVECAPS_VOLUME )
-        {
-            DWORD i_dummy;
-            if( waveOutGetVolume( p_aout->sys->h_waveout, &i_dummy )
-                == MMSYSERR_NOERROR )
-            {
-                p_aout->pf_volume_set = VolumeSet;
-            }
-        }
+                               &wocaps, sizeof(wocaps) ) == MMSYSERR_NOERROR
+         && (wocaps.dwSupport & WAVECAPS_VOLUME) )
+            aout_VolumeHardInit( p_aout, VolumeSet );
+        else
+            aout_VolumeSoftInit( p_aout );
     }
 
 



More information about the vlc-commits mailing list