From dd8e7832c69a5ef484a2f3b6054a482d29275f85 Mon Sep 17 00:00:00 2001 From: deva Date: Sat, 20 May 2006 14:35:59 +0000 Subject: *** empty log message *** --- client/decoder.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'client/decoder.cc') 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() -- cgit v1.2.3