diff options
-rw-r--r-- | src/encoder.cc | 18 | ||||
-rw-r--r-- | src/mainwindow.cc | 1 |
2 files changed, 10 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); } diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 27452ce..9c049ac 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -261,6 +261,7 @@ void MainWindow::cpr_clicked() // TODO: Restore old CPR and name, in the labels. } else { // TODO: Change CPR camera. + camera->setCpr("fisk"); } } |