[vlc-commits] macosx: retain the macosx-audio-device across multiple sessions ( close #6551)

Felix Paul Kühne git at videolan.org
Mon Apr 2 10:12:05 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Apr  2 10:10:31 2012 +0200| [d90a4e3a04489c442c7474a860b7c73e6349a335] | committer: Felix Paul Kühne

macosx: retain the macosx-audio-device across multiple sessions (close #6551)
(cherry picked from commit 4356367929b95f61fae9e98b0d94743ec807701c)

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

 modules/gui/macosx/MainMenu.m |    4 ++++
 modules/gui/macosx/intf.m     |    7 +++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index a43977c..73d3e11 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -1129,6 +1129,10 @@ static VLCMainMenu *_o_sharedInstance = nil;
     if( !strcmp( [menuContent name], "fullscreen" ) || !strcmp( [menuContent name], "video-on-top" ) )
         var_Set( pl_Get( VLCIntf ), [menuContent name] , [menuContent value] );
 
+    /* save our audio device across multiple sessions */
+    if( !strcmp( [menuContent name], "audio-device" ) )
+        config_PutInt( VLCIntf, "macosx-audio-device", [menuContent value].i_int );
+
     p_object = [menuContent vlcObject];
 
     if( p_object != NULL )
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index f3dc1f9..acf1d30 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -617,6 +617,13 @@ static VLCMain *_o_sharedMainInstance = nil;
     if( OSX_LION )
         b_nativeFullscreenMode = config_GetInt( p_intf, "macosx-nativefullscreenmode" );
 #endif
+
+    /* recover stored audio device, if set
+     * in case it was unplugged in the meantime, auhal will fall back on the default */
+    int i_value = config_GetInt( p_intf, "macosx-audio-device" );
+    if (i_value > 0)
+        var_SetInteger( pl_Get( VLCIntf ), "audio-device", i_value );
+
     nib_main_loaded = TRUE;
 }
 



More information about the vlc-commits mailing list