[vlc-commits] auhal: fix a few compilation warnings

Felix Paul Kühne git at videolan.org
Wed Jan 23 00:51:39 CET 2013


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Jan 23 00:42:48 2013 +0100| [b7ce115299db564c46261c8dd0cf513a30c747e5] | committer: Felix Paul Kühne

auhal: fix a few compilation warnings

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

 modules/audio_output/auhal.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index 620ded4..6625069 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -594,11 +594,12 @@ static int OpenAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
 
     /* Set volume for output unit */
     float volume = var_InheritInteger(p_aout, "auhal-volume") / (float)AOUT_VOLUME_DEFAULT;
+    volume = volume * volume * volume;
     verify_noerr(AudioUnitSetParameter(p_sys->au_unit,
                                     kHALOutputParam_Volume,
                                     kAudioUnitScope_Global,
                                     0,
-                                    volume * volume * volume,
+                                    volume,
                                     0));
 
     p_aout->time_get = TimeGetAnalog;
@@ -1048,11 +1049,13 @@ error:
  *****************************************************************************/
 static int AudioDeviceHasOutput(AudioDeviceID i_dev_id)
 {
-    UInt32            dataSize;
+    UInt32 dataSize = 0;
+    OSStatus status;
 
     AudioObjectPropertyAddress streamsAddress = { kAudioDevicePropertyStreams, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster };
-    verify_noerr(AudioObjectGetPropertyDataSize(i_dev_id, &streamsAddress, 0, NULL, &dataSize));
-    if (dataSize == 0)
+    status = AudioObjectGetPropertyDataSize(i_dev_id, &streamsAddress, 0, NULL, &dataSize);
+
+    if (dataSize == 0 || status != noErr)
         return FALSE;
 
     return TRUE;



More information about the vlc-commits mailing list