summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2005-04-26 10:27:14 +0000
committerdeva <deva>2005-04-26 10:27:14 +0000
commit5c756301afdcad05d3b880544b3ea88e50986e21 (patch)
treefc786e62201e87617893b68ce78b6d31f9b37040
parentf3833f876d4d7dff6e247123c7e9ad633a625b74 (diff)
*** empty log message ***
-rw-r--r--src/encoder.cc45
1 files changed, 26 insertions, 19 deletions
diff --git a/src/encoder.cc b/src/encoder.cc
index fc66e27..878c97d 100644
--- a/src/encoder.cc
+++ b/src/encoder.cc
@@ -75,27 +75,34 @@ void Encoder::encode()
pthread_mutex_lock(mutex);
frame = queue->pop();
- queue->plength();
- pthread_mutex_unlock(mutex);
+ // queue->plength();
+ // pthread_mutex_unlock(mutex);
- 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, frame->data, frame->size);
+ while(frame) {
+ if(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, frame->data, frame->size);
+ }
+ if(frame) delete frame;
+
+ // pthread_mutex_lock(mutex);
+ frame = queue->pop();
+ // queue->plength();
}
- if(frame) delete frame;
+ pthread_mutex_unlock(mutex);
}
}