summaryrefslogtreecommitdiff
path: root/client/decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/decoder.cc')
-rw-r--r--client/decoder.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/client/decoder.cc b/client/decoder.cc
index 5c2cce5..ea67d68 100644
--- a/client/decoder.cc
+++ b/client/decoder.cc
@@ -40,6 +40,8 @@
#include <QEvent>
#include <QApplication>
+#include "control.h"
+
Decoder::Decoder(): semaphore(1)
{
frame = NULL;
@@ -63,10 +65,15 @@ void Decoder::run()
while(running) {
char *tmp = (char*)reader.readFrame();
- mutex.lock();
- if(frame) free(frame);
- frame = tmp;
- mutex.unlock();
+
+ if(MIaV::control.isFrozen() == false) {
+ mutex.lock();
+ if(frame) free(frame);
+ frame = tmp;
+ mutex.unlock();
+ } else {
+ free(tmp);
+ }
}
semaphore.release(); // Unlock the shutdown process
}