summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordeva <deva>2005-10-18 14:21:17 +0000
committerdeva <deva>2005-10-18 14:21:17 +0000
commit4a01eed1921b8cd8b8f098ab234ebf75d681b0a9 (patch)
tree499f64642222b606af23dcab19bda57765abd715 /src
parent9b2dd6e5ddd10e9beee061f3d1a25f047d80d290 (diff)
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/camera.cc2
-rw-r--r--src/encoder.cc9
-rw-r--r--src/encoder.h1
3 files changed, 11 insertions, 1 deletions
diff --git a/src/camera.cc b/src/camera.cc
index d24f9af..85ef404 100644
--- a/src/camera.cc
+++ b/src/camera.cc
@@ -127,8 +127,8 @@ void Camera::stop(n_savestate save)
{
if(initialized) {
player->stoprecord(); // For the textoverlay
- decoder->stop(save);
encoder->stop(save);
+ decoder->stop(save);
} else {
info->error("Camera not initialized.");
}
diff --git a/src/encoder.cc b/src/encoder.cc
index b4227b0..4898888 100644
--- a/src/encoder.cc
+++ b/src/encoder.cc
@@ -35,6 +35,7 @@
#include <config.h>
#ifdef USE_GUI
+#include "util.h"
#include "encoder.h"
Encoder::Encoder(Info *ginfo,
@@ -65,6 +66,7 @@ Encoder::Encoder(Info *ginfo,
frozen = false;
+ savestate_sent = false;
savestate = NO_CHANGE;
// shoot_request = 0;
@@ -113,6 +115,8 @@ void Encoder::encode()
n_header h;
+ if(savestate != NO_CHANGE) savestate_sent = true;
+
h.header_type = DATA_HEADER;
sprintf(h.header.h_data.cpr, cpr);
h.header.h_data.freeze = frame->freeze;
@@ -223,6 +227,11 @@ void Encoder::start()
void Encoder::stop(n_savestate save)
{
savestate = save;
+ // Don't return until we are sure the savestate has been sent.
+ while(savestate_sent == false) {
+ // Just wait a while (in a while!)
+ sleep_0_2_frame();
+ }
/*
struct timespec ts;
// TODO: set save state in package header.
diff --git a/src/encoder.h b/src/encoder.h
index 2aa8729..a8ffcc5 100644
--- a/src/encoder.h
+++ b/src/encoder.h
@@ -103,6 +103,7 @@ private:
// volatile int freeze_request;
// int freeze_value;
+ volatile bool savestate_sent;
volatile n_savestate savestate;
sem_t record_sem;