Skip to content

Commit c0b94a8

Browse files
committed
Fix Build Compatibility Issues in XCode 26.4
Replaced Implicit type conversion within mac plugins(mac-capture, mac-syphon, mac-videotoolbox, mac-virtualcam) with Explicit ones to clear compile errors with Apple Clang 21.0 and XCode 26.4.
1 parent 3a9cf4a commit c0b94a8

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

plugins/mac-capture/mac-audio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ static OSStatus input_callback(void *data, AudioUnitRenderActionFlags *action_fl
445445
factor = ((double)info.numer) / info.denom;
446446
}
447447
if (info.numer != info.denom)
448-
audio.timestamp = (uint64_t)(factor * ts_data->mHostTime);
448+
audio.timestamp = (uint64_t)(factor * (double)ts_data->mHostTime);
449449
else
450450
audio.timestamp = ts_data->mHostTime;
451451

plugins/mac-capture/mac-sck-common.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ bool build_application_list(struct screen_capture *sc, obs_properties_t *props)
278278
size_t width = CVPixelBufferGetWidth(image_buffer);
279279
size_t height = CVPixelBufferGetHeight(image_buffer);
280280

281-
if ((sc->frame.size.width != width) || (sc->frame.size.height != height)) {
282-
sc->frame.size.width = width;
283-
sc->frame.size.height = height;
281+
if (((size_t)sc->frame.size.width != width) || ((size_t)sc->frame.size.height != height)) {
282+
sc->frame.size.width = (CGFloat)width;
283+
sc->frame.size.height = (CGFloat)height;
284284
needs_to_update_properties = true;
285285
}
286286
}

plugins/mac-syphon/syphon.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static void syphon_video_tick(void *data, float seconds)
632632

633633
obs_enter_graphics();
634634
build_sprite_rect(gs_vertexbuffer_get_data(s->vertbuffer), (float) crop->origin.x,
635-
s->height - (float) crop->origin.y, s->width - (float) crop->size.width,
635+
(float) s->height - (float) crop->origin.y, (float) s->width - (float) crop->size.width,
636636
(float) crop->size.height);
637637
obs_leave_graphics();
638638
}

plugins/mac-videotoolbox/encoder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ static OSStatus create_encoder(struct vt_encoder *enc)
539539
kVTCompressionPropertyKey_AllowFrameReordering,
540540
kVTCompressionPropertyKey_ProfileLevel};
541541

542-
SInt32 key_frame_interval = (SInt32)(enc->keyint * ((float)enc->fps_num / enc->fps_den));
543-
float expected_framerate = (float)enc->fps_num / enc->fps_den;
542+
SInt32 key_frame_interval = (SInt32)((float)enc->keyint * ((float)enc->fps_num / (float)enc->fps_den));
543+
float expected_framerate = (float)enc->fps_num / (float)enc->fps_den;
544544
CFNumberRef MaxKeyFrameInterval =
545545
CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &key_frame_interval);
546546
CFNumberRef ExpectedFrameRate =

plugins/mac-virtualcam/src/dal-plugin/CMSampleBufferUtils.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ CMSampleTimingInfo CMSampleTimingInfoForTimestamp(uint64_t timestampNanos, uint3
1919
CMTimeScale scale = 600;
2020
CMSampleTimingInfo timing;
2121
timing.duration = CMTimeMake(fpsDenominator * scale, fpsNumerator * scale);
22-
timing.presentationTimeStamp = CMTimeMakeWithSeconds(timestampNanos / (double) NSEC_PER_SEC, scale);
22+
timing.presentationTimeStamp = CMTimeMakeWithSeconds((double)timestampNanos / (double) NSEC_PER_SEC, scale);
2323
timing.decodeTimeStamp = kCMTimeInvalid;
2424
return timing;
2525
}

plugins/mac-virtualcam/src/dal-plugin/OBSDALStream.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ - (NSSize)testCardSize
128128
if (width == 0 || height == 0) {
129129
_testCardSize = NSMakeSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
130130
} else {
131-
_testCardSize = NSMakeSize(width, height);
131+
_testCardSize = NSMakeSize((double)width, (double)height);
132132
}
133133
}
134134
return _testCardSize;
@@ -240,7 +240,7 @@ - (CVPixelBufferRef)createPixelBufferWithTestAnimation
240240
CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB();
241241
CGContextRef context = CGBitmapContextCreate(pxdata, width, height, 8,
242242
CVPixelBufferGetBytesPerRowOfPlane(pxbuffer, 0), rgbColorSpace,
243-
kCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Big);
243+
((int)kCGImageAlphaPremultipliedFirst) | ((int)kCGImageByteOrder32Big));
244244
CFRelease(rgbColorSpace);
245245
NSParameterAssert(context);
246246

@@ -249,7 +249,7 @@ - (CVPixelBufferRef)createPixelBufferWithTestAnimation
249249

250250
NSRect rect = NSMakeRect(0, 0, self.testCardImage.size.width, self.testCardImage.size.height);
251251
CGImageRef image = [self.testCardImage CGImageForProposedRect:&rect context:nsContext hints:nil];
252-
CGContextDrawImage(context, CGRectMake(0, 0, CGImageGetWidth(image), CGImageGetHeight(image)), image);
252+
CGContextDrawImage(context, CGRectMake(0, 0, (double)CGImageGetWidth(image), (double)CGImageGetHeight(image)), image);
253253

254254
// DrawDialWithFrame(
255255
// NSMakeRect(0, 0, width, height),

0 commit comments

Comments
 (0)