From: Tomas Wenström Date: Sun, 11 Aug 2019 10:45:54 +0000 (+0200) Subject: Only output bytes read when something's wrong X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=48d4699cf1e92ae7f744c866790417984ec36005;p=kaka%2Fcakelight.git Only output bytes read when something's wrong --- diff --git a/src/kaka/cakelight/FrameGrabber.java b/src/kaka/cakelight/FrameGrabber.java index 1db5c2c..e654c91 100644 --- a/src/kaka/cakelight/FrameGrabber.java +++ b/src/kaka/cakelight/FrameGrabber.java @@ -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();