]> www.dolda2000.com Git - kaka/cakelight.git/commitdiff
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 1db5c2c7611cc18f25a84e6506564efd66204b7d..e654c9183075f51198340ea0184cf79210915c28 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();