[vlc-commits] macosx: Fix misbehaving audio device popups
David Fuhrmann
git at videolan.org
Sun Aug 5 21:17:39 CEST 2018
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | 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
More information about the vlc-commits
mailing list