refine flush_if_sec behavior

The new behavior eliminates a couple unpleasant edge cases in which it
would never flush:

* if all recording stops, whatever was unflushed would stay that way
* if every recording attempt produces a 0-duration recording (such as if the
  camera sends only one frame and thus no PTS delta can be calculated),
  the list of recordings to flush would continue to grow
This commit is contained in:
Scott Lamb
2018-03-23 15:16:43 -07:00
parent addeb9d2f6
commit 91636d3193
7 changed files with 124 additions and 60 deletions

View File

@@ -564,7 +564,7 @@ mod bench {
impl Server {
fn new() -> Server {
let db = TestDb::new();
let db = TestDb::new(::base::clock::RealClocks {});
let test_camera_uuid = db.test_camera_uuid;
testutil::add_dummy_recordings_to_db(&db.db, 1440);
let (tx, rx) = ::std::sync::mpsc::channel();