Commits

Cliff Biffle committed 0f04e8d

KVKinectHardware was setting the wrong length on the data it broadcast. Nobody noticed because nobody checked the data, but the recorder was getting hosed.

  • Participants
  • Parent commits d26d9f0

Comments (0)

Files changed (1)

File KVKinectHardware.m

 @end
 
 static void depthCallback(freenect_device *dev, freenect_depth *depth, uint32_t timestamp) {
-  ((KVKinectHardware *)freenect_get_user(dev)).latestDepthSamples = [NSData dataWithBytesNoCopy: depth length: sizeof *depth freeWhenDone: NO];
+  ((KVKinectHardware *)freenect_get_user(dev)).latestDepthSamples =
+      [NSData dataWithBytesNoCopy: depth length: (640 * 480 * sizeof(uint16_t)) freeWhenDone: NO];
 }
 static void rgbCallback(freenect_device *dev, freenect_pixel *rgb, uint32_t timestamp) {
-  ((KVKinectHardware *)freenect_get_user(dev)).latestColorSamples = [NSData dataWithBytesNoCopy: rgb length: sizeof *rgb freeWhenDone: NO];
+  ((KVKinectHardware *)freenect_get_user(dev)).latestColorSamples =
+      [NSData dataWithBytesNoCopy: rgb length: (640 * 480 * 3) freeWhenDone: NO];
 }
 
 @implementation KVKinectHardware