Commit ce66ed5d authored by Michael Feurstein's avatar Michael Feurstein Committed by Felix Paul Kühne

qtsound: fixes bug if no device is connected

Signed-off-by: default avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 54205a27
......@@ -322,6 +322,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
[[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidUnmountNotification object:nil];
[self performSelector:@selector(scanOpticalMedia:) withObject:nil afterDelay:2.0];
[self performSelector:@selector(qtkChanged:) withObject:nil afterDelay:2.5];
[self performSelector:@selector(qtkAudioChanged:) withObject:nil afterDelay:3.0];
[self setMRL: @""];
}
......@@ -517,6 +518,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
- (IBAction)qtkChanged:(id)sender
{
NSInteger i_selectedDevice = [o_qtk_device_pop indexOfSelectedItem];
if( [qtkvideoDevices count] >= 1 )
{
NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex: 0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
[o_capture_width_fld setIntValue: [sizes sizeValue].width];
......@@ -525,13 +528,17 @@ static VLCOpen *_o_sharedMainInstance = nil;
[o_capture_height_stp setIntValue: [o_capture_height_fld intValue]];
qtk_currdevice_uid = [[(QTCaptureDevice *)[qtkvideoDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
[self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]];
}
}
- (IBAction)qtkAudioChanged:(id)sender
{
NSInteger i_selectedDevice = [o_qtkaudio_device_pop indexOfSelectedItem];
if( [qtkaudioDevices count] >= 1 )
{
qtkaudio_currdevice_uid = [[(QTCaptureDevice *)[qtkaudioDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
[self setMRL:[NSString stringWithFormat:@"qtsound://%@", qtkaudio_currdevice_uid]];
}
}
- (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment