From c02c96161dde9d6ca7b408cf08fcf10bd8e61a54 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 15 Oct 2013 09:25:11 -0700 Subject: Fix bug with not reporting lost bytes Change-Id: I431d989dbd115b43822e9e48fd4c2b8e6322cfe3 --- media/libnbaio/NBLog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'media/libnbaio/NBLog.cpp') diff --git a/media/libnbaio/NBLog.cpp b/media/libnbaio/NBLog.cpp index 895fd60..96738a7 100644 --- a/media/libnbaio/NBLog.cpp +++ b/media/libnbaio/NBLog.cpp @@ -341,8 +341,8 @@ void NBLog::Reader::dump(int fd, size_t indent) mFd = fd; mIndent = indent; String8 timestamp, body; - if (i > 0) { - lost += i; + lost += i; + if (lost > 0) { body.appendFormat("warning: lost %u bytes worth of events", lost); // TODO timestamp empty here, only other choice to wait for the first timestamp event in the // log to push it out. Consider keeping the timestamp/body between calls to readAt(). -- cgit v1.1