diff --git a/src/zm_db.cpp b/src/zm_db.cpp
index f659bb361..e3b737c07 100644
--- a/src/zm_db.cpp
+++ b/src/zm_db.cpp
@@ -255,7 +255,7 @@ void zmDbQueue::process() {
Logger *log = Logger::fetch();
Logger::Level db_level = log->databaseLevel();
log->databaseLevel(Logger::NOLOG);
- Warning("db queue size has grown larger than 10 entries");
+ Warning("db queue size has grown larger %zu than 10 entries", mQueue.size());
log->databaseLevel(db_level);
}
std::string sql = mQueue.front();
diff --git a/src/zm_event.cpp b/src/zm_event.cpp
index adda18655..14b0fc9a3 100644
--- a/src/zm_event.cpp
+++ b/src/zm_event.cpp
@@ -479,7 +479,7 @@ void Event::AddFrame(Image *image,
Debug(1, "Writing snapshot");
WriteFrameImage(image, timestamp, snapshot_file.c_str());
} else {
- Debug(1, "Not Writing snapshot");
+ Debug(1, "Not Writing snapshot because score %d > max %d", score, max_score);
}
// We are writing an Alarm frame
@@ -491,7 +491,7 @@ void Event::AddFrame(Image *image,
Debug(1, "Writing alarm image");
WriteFrameImage(image, timestamp, alarm_file.c_str());
} else {
- Debug(1, "Not Writing alarm image");
+ Debug(3, "Not Writing alarm image because alarm frame already written");
}
if (alarm_image and (save_jpegs & 2)) {
diff --git a/src/zm_videostore.cpp b/src/zm_videostore.cpp
index 2b9f662e6..ad401b22c 100644
--- a/src/zm_videostore.cpp
+++ b/src/zm_videostore.cpp
@@ -619,7 +619,8 @@ VideoStore::~VideoStore() {
Debug(1, "Writing trailer");
/* Write the trailer before close */
- if (int rc = av_write_trailer(oc)) {
+ int rc;
+ if ((rc = av_write_trailer(oc)) < 0) {
Error("Error writing trailer %s", av_err2str(rc));
} else {
Debug(3, "Success Writing trailer");
@@ -629,7 +630,7 @@ VideoStore::~VideoStore() {
if (!(out_format->flags & AVFMT_NOFILE)) {
/* Close the out file. */
Debug(4, "Closing");
- if (int rc = avio_close(oc->pb)) {
+ if ((rc = avio_close(oc->pb)) < 0) {
Error("Error closing avio %s", av_err2str(rc));
}
} else {
diff --git a/web/ajax/events.php b/web/ajax/events.php
index 6d87da869..4e364242a 100644
--- a/web/ajax/events.php
+++ b/web/ajax/events.php
@@ -239,15 +239,17 @@ function queryRequest($filter, $search, $advsearch, $sort, $offset, $order, $lim
} # end if search
$sql = 'SELECT ' .$col_str. ' FROM `Events` AS E INNER JOIN Monitors AS M ON E.MonitorId = M.Id WHERE '.$search_filter->sql().' ORDER BY ' .$sort. ' ' .$order;
- ZM\Debug('Calling the following sql query: ' .$sql);
$filtered_rows = dbFetchAll($sql);
- ZM\Debug('Have ' . count($filtered_rows) . ' events matching search filter.');
+ ZM\Debug('Have ' . count($filtered_rows) . ' events matching search filter: '.$sql);
} else {
$filtered_rows = $unfiltered_rows;
} # end if search_filter->terms() > 1
+ if ($limit)
+ $filtered_rows = array_slice($filtered_rows, $offset, $limit);
+
$returned_rows = array();
- foreach ( array_slice($filtered_rows, $offset, $limit) as $row ) {
+ foreach ($filtered_rows as $row) {
$event = new ZM\Event($row);
$scale = intval(5*100*ZM_WEB_LIST_THUMB_WIDTH / $event->Width());
diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php
index 1b01a73e8..c593601aa 100644
--- a/web/skins/classic/includes/functions.php
+++ b/web/skins/classic/includes/functions.php
@@ -916,7 +916,7 @@ function xhtmlFooter() {
?>
-
+