Cliff Biffle avatar 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.

Comments (0)

Files changed (1)

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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.