From 1c57e16f7dbf82128ab9426f3b9a1da6a2b44750 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 2 Mar 2004 16:32:31 +0000 Subject: [PATCH] Defined base sample rate. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@907 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_config.h.z | 3 +++ src/zma.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/zm_config.h.z b/src/zm_config.h.z index 445bfdb74..bd39c0c34 100644 --- a/src/zm_config.h.z +++ b/src/zm_config.h.z @@ -40,6 +40,9 @@ #define ZM_SCALE_SCALE 100 // The factor by which we bump up 'scale' to simulate FP #define ZM_RATE_SCALE 100 // The factor by which we bump up 'rate' to simulate FP +#define ZM_MAX_FPS 30 // The maximum frame rate we expect to handle +#define ZM_SAMPLE_RATE int(1000000/ZM_MAX_FPS) // A general nyquist sample frequency for delays etc + class ConfigItem { private: diff --git a/src/zma.cpp b/src/zma.cpp index e2e0d1b31..a4d566a18 100644 --- a/src/zma.cpp +++ b/src/zma.cpp @@ -160,7 +160,7 @@ int main( int argc, char *argv[] ) sigprocmask( SIG_BLOCK, &block_set, 0 ); if ( !monitor->Analyse() ) { - usleep( 16666 ); // Nyquist sampling rate at 30fps, wouldn't expect any more than this + usleep( ZM_SAMPLE_RATE ); // Nyquist sampling rate at 30fps, wouldn't expect any more than this } sigprocmask( SIG_UNBLOCK, &block_set, 0 ); }