From 5c756301afdcad05d3b880544b3ea88e50986e21 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 26 Apr 2005 10:27:14 +0000 Subject: *** empty log message *** --- src/encoder.cc | 45 ++++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'src/encoder.cc') 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); } } -- cgit v1.2.3