diff options
Diffstat (limited to 'src/encoder.cc')
-rw-r--r-- | src/encoder.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/encoder.cc b/src/encoder.cc index 714ee81..d3f4925 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -68,37 +68,37 @@ Encoder::~Encoder() void Encoder::encode() { - Frame *f; + Frame *frame; while(*running) { sem_wait(sem); pthread_mutex_lock(mutex); - f = queue->pop(); + frame = queue->pop(); pthread_mutex_unlock(mutex); - if((f && record) || + if((frame && record) || (freeze_request != freeze_value) || (shoot_request != shoot_value)) { n_header h; - + h.header_type = DATA_HEADER; sprintf(h.header.h_data.cpr, cpr); h.header.h_data.freeze = (freeze_request != freeze_value); h.header.h_data.snapshot = (shoot_request != shoot_value); h.header.h_data.record = record; h.header.h_data.savestate = NO_CHANGE; - + if(freeze_request != freeze_value) freeze_value = freeze_request; if(shoot_request != shoot_value) shoot_value = shoot_request; - - n->sendPackage(&h, f->data, f->size); - + + n->sendPackage(&h, frame->data, frame->size); + // free(f->data); // delete f; } } - pthread_exit(NULL); + // pthread_exit(NULL); } |