[vlc-devel] [PATCH 01/12] changed array access in access qt*.m and avcapture.m

Benedikt Bergenthal benedikt at kdrennert.de
Fri May 10 18:47:50 CEST 2013


diff --git a/modules/access/avcapture.m b/modules/access/avcapture.m
index ad09735..82bf751 100644
--- a/modules/access/avcapture.m
+++ b/modules/access/avcapture.m
@@ -296,7 +296,7 @@ static int Open(vlc_object_t *p_this)
     for ( ivideo = 0; ivideo < deviceCount; ivideo++ )
     {
         AVCaptureDevice *avf_device;
-        avf_device = myVideoDevices[ivideo];
+        avf_device = [myVideoDevices objectAtIndex:ivideo];
         msg_Dbg(p_demux, "avcapture %u/%u %s %s", ivideo, deviceCount, [[avf_device modelID] UTF8String], [[avf_device uniqueID] UTF8String]);
         if ([[[avf_device uniqueID]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:avf_currdevice_uid]) {
             break;
@@ -305,7 +305,7 @@ static int Open(vlc_object_t *p_this)
 
     if ( ivideo < [myVideoDevices count] )
     {
-       p_sys->device = myVideoDevices[ivideo];
+       p_sys->device = [myVideoDevices objectAtIndex:ivideo];
     }
     else
     {
diff --git a/modules/access/qtcapture.m b/modules/access/qtcapture.m
index 9fadd5f..20ea8b7 100644
--- a/modules/access/qtcapture.m
+++ b/modules/access/qtcapture.m
@@ -256,7 +256,7 @@ static int Open(vlc_object_t *p_this)
     NSUInteger deviceCount = [myVideoDevices count];
     for (ivideo = 0; ivideo < deviceCount; ivideo++) {
         QTCaptureDevice *qtk_device;
-        qtk_device = myVideoDevices[ivideo];
+        qtk_device = [myVideoDevices objectAtIndex:ivideo];
         msg_Dbg(p_demux, "qtcapture %lu/%lu %s %s", ivideo, deviceCount, [[qtk_device localizedDisplayName] UTF8String], [[qtk_device uniqueID] UTF8String]);
         if ([[[qtk_device uniqueID]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:qtk_currdevice_uid]) {
             break;
@@ -268,7 +268,7 @@ static int Open(vlc_object_t *p_this)
     QTCaptureDeviceInput * input = nil;
     NSError *o_returnedError;
     if (ivideo < [myVideoDevices count])
-        p_sys->device = myVideoDevices[ivideo];
+        p_sys->device =[myVideoDevices objectAtIndex:ivideo];
     else {
         /* cannot found designated device, fall back to open default device */
         msg_Dbg(p_demux, "Cannot find designated uid device as %s, falling back to default.", [qtk_currdevice_uid UTF8String]);
@@ -306,13 +306,13 @@ static int Open(vlc_object_t *p_this)
     QTFormatDescription* camera_format = NULL;
     NSUInteger formatCount = [format_array count];
     for (NSUInteger k = 0; k < formatCount; k++) {
-        camera_format = format_array[k];
+        camera_format = [format_array objectAtIndex:k];
 
         msg_Dbg(p_demux, "localized Format: %s", [[camera_format localizedFormatSummary] UTF8String]);
         msg_Dbg(p_demux, "format description: %s", [[[camera_format formatDescriptionAttributes] description] UTF8String]);
     }
     if ([format_array count])
-        camera_format = format_array[0];
+        camera_format = [format_array objectAtIndex:0];
     else
         goto error;
 
@@ -347,7 +347,7 @@ static int Open(vlc_object_t *p_this)
         @(kCVPixelFormatType_422YpCbCr8), (id)kCVPixelBufferPixelFormatTypeKey,
         @(p_sys->height), kCVPixelBufferHeightKey,
         @(p_sys->width), kCVPixelBufferWidthKey,
-        @YES, (id)kCVPixelBufferOpenGLCompatibilityKey,
+        YES, (id)kCVPixelBufferOpenGLCompatibilityKey,
         nil]];
     [p_sys->output setAutomaticallyDropsLateVideoFrames:YES];
     [p_sys->output setMinimumVideoFrameInterval: (1/25)]; // 25 fps
diff --git a/modules/access/qtsound.m b/modules/access/qtsound.m
index 2b51397..00fc873 100644
--- a/modules/access/qtsound.m
+++ b/modules/access/qtsound.m
@@ -275,7 +275,7 @@ static int Open(vlc_object_t *p_this)
     unsigned iaudio;
     for (iaudio = 0; iaudio < [myAudioDevices count]; iaudio++) {
         QTCaptureDevice *qtk_audioDevice;
-        qtk_audioDevice = myAudioDevices[iaudio];
+        qtk_audioDevice = [myAudioDevices objectAtIndex:iaudio];
         msg_Dbg(p_demux, "qtsound audio %u/%lu localizedDisplayName: %s uniqueID: %s", iaudio, [myAudioDevices count], [[qtk_audioDevice localizedDisplayName] UTF8String], [[qtk_audioDevice uniqueID] UTF8String]);
         if ([[[qtk_audioDevice uniqueID]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:qtk_curraudiodevice_uid]) {
             msg_Dbg(p_demux, "Device found");
@@ -285,7 +285,7 @@ static int Open(vlc_object_t *p_this)
 
     audioInput = nil;
     if(iaudio < [myAudioDevices count])
-        p_sys->audiodevice = myAudioDevices[iaudio];
+        p_sys->audiodevice = [myAudioDevices objectAtIndex:iaudio];
     else {
         /* cannot find designated audio device, fall back to open default audio device */
         msg_Dbg(p_demux, "Cannot find designated uid audio device as %s. Fall back to open default audio device.", [qtk_curraudiodevice_uid UTF8String]);
@@ -357,7 +357,7 @@ static int Open(vlc_object_t *p_this)
     audioformat_array = [p_sys->audiodevice formatDescriptions];
     audio_format = NULL;
     for(int k = 0; k < [audioformat_array count]; k++) {
-        audio_format = (QTFormatDescription *)audioformat_array[k];
+        audio_format = (QTFormatDescription *)[audioformat_array objectAtIndex:k];
 
         msg_Dbg(p_demux, "Audio localized format summary: %s", [[audio_format localizedFormatSummary] UTF8String]);
         msg_Dbg(p_demux, "Audio format description attributes: %s",[[[audio_format formatDescriptionAttributes] description] UTF8String]);
@@ -400,7 +400,7 @@ static int Open(vlc_object_t *p_this)
     }
 
     if([audioformat_array count])
-        audio_format = audioformat_array[0];
+        audio_format = [audioformat_array objectAtIndex:0];
     else
         goto error;
 
-- 
1.8.2.2




More information about the vlc-devel mailing list