Only output bytes read when something's wrong
authorTomas Wenström <tomas.wenstrom@gmail.com>
Sun, 11 Aug 2019 10:45:54 +0000 (12:45 +0200)
committerTomas Wenström <tomas.wenstrom@gmail.com>
Sun, 11 Aug 2019 10:45:54 +0000 (12:45 +0200)
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();