diff options
Diffstat (limited to 'src/encoder.cc')
-rw-r--r-- | src/encoder.cc | 9 |
1 files changed, 9 insertions, 0 deletions
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. |