From 492be7cc33bc4bc0a0b49b4f9fbe0fd56be41af5 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 26 Sep 2019 13:51:49 -0400 Subject: [PATCH] make last_zoom last_scale last_x and last_y members of the StreamBase object instead of static vars so that we can access them in monitorStream --- src/zm_stream.cpp | 9 --------- src/zm_stream.h | 11 +++++++---- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/zm_stream.cpp b/src/zm_stream.cpp index 732b1b810..ee874cf64 100644 --- a/src/zm_stream.cpp +++ b/src/zm_stream.cpp @@ -110,15 +110,6 @@ bool StreamBase::checkCommandQueue() { } Image *StreamBase::prepareImage( Image *image ) { - static int last_scale = 0; - static int last_zoom = 0; - static int last_x = 0; - static int last_y = 0; - - if ( !last_scale ) - last_scale = scale; - if ( !last_zoom ) - last_zoom = zoom; // Do not bother to scale zoomed in images, just crop them and let the browser scale // Works in FF2 but breaks FF3 which doesn't like image sizes changing in mid stream. diff --git a/src/zm_stream.h b/src/zm_stream.h index d4443cb39..eb99b74c1 100644 --- a/src/zm_stream.h +++ b/src/zm_stream.h @@ -66,9 +66,12 @@ protected: const char *format; int replay_rate; int scale; + int last_scale; int zoom; + int last_zoom; double maxfps; int bitrate; + unsigned short last_x, last_y; unsigned short x, y; protected: @@ -117,15 +120,15 @@ public: type = DEFAULT_TYPE; format = ""; replay_rate = DEFAULT_RATE; - scale = DEFAULT_SCALE; - zoom = DEFAULT_ZOOM; + last_scale = scale = DEFAULT_SCALE; + last_zoom = zoom = DEFAULT_ZOOM; maxfps = DEFAULT_MAXFPS; bitrate = DEFAULT_BITRATE; paused = false; step = 0; - x = 0; - y = 0; + last_x = x = 0; + last_y = y = 0; connkey = 0; sd = -1;