[vlc-commits] macosx: Fix misbehaving audio device popups

David Fuhrmann git at videolan.org
Sun Aug 5 21:18:41 CEST 2018


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun Jul 22 21:05:51 2018 +0200| [5090d8ce426bd5e757c95d33b2d4ea57bebe20c2] | committer: David Fuhrmann

macosx: Fix misbehaving audio device popups

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

refs #20766

(cherry picked from commit 558c52cf5cfc1ff0604b6c12c5865c6b052d1cc0)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>

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

 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 c08266d68f..de8722fc4c 100644
--- a/modules/gui/macosx/VLCOpenWindowController.m
+++ b/modules/gui/macosx/VLCOpenWindowController.m
@@ -1198,19 +1198,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



More information about the vlc-commits mailing list