[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:11:45 CEST 2012
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Apr 2 10:10:31 2012 +0200| [4356367929b95f61fae9e98b0d94743ec807701c] | committer: Felix Paul Kühne
macosx: retain the macosx-audio-device across multiple sessions (close #6551)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4356367929b95f61fae9e98b0d94743ec807701c
---
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 988652a..2cc8143 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -618,6 +618,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