summaryrefslogtreecommitdiff
path: root/client/decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/decoder.cc')
-rw-r--r--client/decoder.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/client/decoder.cc b/client/decoder.cc
index 5421e16..0ed2032 100644
--- a/client/decoder.cc
+++ b/client/decoder.cc
@@ -44,9 +44,8 @@
#include "libdv_wrapper.h"
-Decoder::Decoder(NetworkSender *ns): closesem(1)
+Decoder::Decoder()
{
- sender = ns;
running = true;
memset(pframe, 0, sizeof(pframe)); // Init an empty frame
qApp->installEventFilter(this);
@@ -58,7 +57,9 @@ Decoder::~Decoder()
void Decoder::run()
{
- closesem.acquire(); // Lock the shutdown process
+ bool newconnection = true;
+
+ // closesem.acquire(); // Lock the shutdown process
#ifdef READ_DV_FROM_FILE
dvfile reader;
@@ -77,9 +78,20 @@ void Decoder::run()
pmutex.unlock();
}
- free(frame);
+ if(MIaV::control.isRecording()) {
+ if(newconnection) {
+ NetworkSender *sender = new NetworkSender(MIaV::control.getCpr());
+ senders.push_back(sender);
+ sender->start();
+ newconnection = false;
+ }
+ senders.front()->pushFrame(frame, false, false);
+ } else {
+ free(frame);
+ newconnection = true;
+ }
}
- closesem.release(); // Unlock the shutdown process
+ // closesem.release(); // Unlock the shutdown process
}
char *Decoder::pframeAcquire()