Преглед изворни кода

mac-capture: Use resize instead of reserve

Better practice for the tracked size to be nonzero.

This does NOT speed up window capture significantly.
jpark37 пре 5 година
родитељ
комит
3d6bec6d2d
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      plugins/mac-capture/mac-window-capture.m

+ 1 - 1
plugins/mac-capture/mac-window-capture.m

@@ -51,7 +51,7 @@ static inline void capture_frame(struct window_capture *wc)
 	size_t height = CGImageGetHeight(img);
 	size_t height = CGImageGetHeight(img);
 
 
 	CGRect rect = {{0, 0}, {width, height}};
 	CGRect rect = {{0, 0}, {width, height}};
-	da_reserve(wc->buffer, width * height * 4);
+	da_resize(wc->buffer, width * height * 4);
 	uint8_t *data = wc->buffer.array;
 	uint8_t *data = wc->buffer.array;
 
 
 	CGContextRef cg_context = CGBitmapContextCreate(
 	CGContextRef cg_context = CGBitmapContextCreate(