[vlc-commits] macosx: add missing vlc_object_release and stuff for audio device selection

David Fuhrmann git at videolan.org
Sat Feb 16 17:39:46 CET 2013


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sat Feb 16 17:38:34 2013 +0100| [2a07b5465d71834af3cb4a1953fa2fb356f6808b] | committer: David Fuhrmann

macosx: add missing vlc_object_release and stuff for audio device selection

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

 modules/gui/macosx/MainMenu.m |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index 24979f0..1f67adf 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -766,17 +766,20 @@ static VLCMainMenu *_o_sharedInstance = nil;
 - (IBAction)toggleAudioDevice:(id)sender
 {
     audio_output_t * p_aout = getAout();
+    if (!p_aout)
+        return;
 
     int returnValue = 0;
 
     if ([sender tag] > 0)
-        aout_DeviceSet(p_aout, [[NSString stringWithFormat:@"%li", [sender tag]] UTF8String]);
+        returnValue = aout_DeviceSet(p_aout, [[NSString stringWithFormat:@"%li", [sender tag]] UTF8String]);
     else
-        aout_DeviceSet(p_aout, NULL);
+        returnValue = aout_DeviceSet(p_aout, NULL);
 
     if (returnValue != 0)
         msg_Warn(VLCIntf, "failed to set audio device %li", [sender tag]);
 
+    vlc_object_release(p_aout);
     [self refreshAudioDeviceList];
 }
 



More information about the vlc-commits mailing list