vlc | branch: master | David Fuhrmann <[email protected]> | Sun Jul 22 
21:05:51 2018 +0200| [558c52cf5cfc1ff0604b6c12c5865c6b052d1cc0] | committer: 
David Fuhrmann

macosx: Fix misbehaving audio device popups

Prevents changing selection automatically, note that the audioChanged
selector is used multiple times.

refs #20766

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

 modules/gui/macosx/VLCOpenWindowController.m | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/VLCOpenWindowController.m 
b/modules/gui/macosx/VLCOpenWindowController.m
index e5ae186ce6..8c05a0d0c2 100644
--- a/modules/gui/macosx/VLCOpenWindowController.m
+++ b/modules/gui/macosx/VLCOpenWindowController.m
@@ -1197,19 +1197,19 @@ static NSString *kCaptureTabViewId  = @"capture";
 - (IBAction)qtkChanged:(id)sender
 {
     NSInteger selectedDevice = [_qtkVideoDevicePopup indexOfSelectedItem];
-    if (_avvideoDevices.count >= 1) {
-        _avCurrentDeviceUID = [[(AVCaptureDevice *)[_avvideoDevices 
objectAtIndex:selectedDevice] uniqueID] 
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
-    }
+    if (selectedDevice >= _avvideoDevices.count)
+        return;
+
+    _avCurrentDeviceUID = [[(AVCaptureDevice *)[_avvideoDevices 
objectAtIndex:selectedDevice] uniqueID] 
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
 }
 
 - (IBAction)qtkAudioChanged:(id)sender
 {
     NSInteger selectedDevice = [_qtkAudioDevicePopup indexOfSelectedItem];
-    if (_avaudioDevices.count >= 1) {
-        _avCurrentAudioDeviceUID = [[(AVCaptureDevice *)[_avaudioDevices 
objectAtIndex:selectedDevice] uniqueID] 
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
-    }
-    [_screenqtkAudioPopup selectItemAtIndex: selectedDevice];
-    [_qtkAudioDevicePopup selectItemAtIndex: selectedDevice];
+    if (selectedDevice >= _avaudioDevices.count)
+        return;
+
+    _avCurrentAudioDeviceUID = [[(AVCaptureDevice *)[_avaudioDevices 
objectAtIndex:selectedDevice] uniqueID] 
stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
 }
 
 - (IBAction)qtkToggleUIElements:(id)sender

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to