summaryrefslogtreecommitdiff
path: root/client/decoder.cc
diff options
context:
space:
mode:
authordeva <deva>2006-05-20 14:35:59 +0000
committerdeva <deva>2006-05-20 14:35:59 +0000
commitdd8e7832c69a5ef484a2f3b6054a482d29275f85 (patch)
tree6865f4f18d8545a0edecbb3646f69039ccc82727 /client/decoder.cc
parent60c43b0a065175a49ae0aa2b10280e893479889b (diff)
*** empty log message ***
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()