Only output bytes read when something's wrong
[kaka/cakelight.git] / src / kaka / cakelight / FrameGrabber.java
index 1db5c2c..e654c91 100644 (file)
@@ -41,7 +41,9 @@ public class FrameGrabber implements Closeable {
         try {
             byte[] data = new byte[bytesPerFrame];
             int count = fileStream.read(data);
-            log("# of bytes read = " + count);
+            if (count != bytesPerFrame) {
+                log("Expected to read " + bytesPerFrame + " bytes per frame but read " + count);
+            }
             return Optional.of(VideoFrame.of(data, config));
         } catch (IOException e) {
             e.printStackTrace();