From 48d4699cf1e92ae7f744c866790417984ec36005 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tomas=20Wenstr=C3=B6m?= Date: Sun, 11 Aug 2019 12:45:54 +0200 Subject: [PATCH] Only output bytes read when something's wrong --- src/kaka/cakelight/FrameGrabber.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.11.0