From 52fd913be8b044f1d064973c53b4467e5bd153fe Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 19 Jun 2005 11:44:14 +0000 Subject: Cleaned up a log of logging. Fixed server queue (shouldn't happen). Added user and group lookup. --- src/mov_encoder.cc | 74 +++++++----------------------------------------------- 1 file changed, 9 insertions(+), 65 deletions(-) (limited to 'src/mov_encoder.cc') diff --git a/src/mov_encoder.cc b/src/mov_encoder.cc index 908e857..b31e1c9 100644 --- a/src/mov_encoder.cc +++ b/src/mov_encoder.cc @@ -39,6 +39,11 @@ /* * $Log$ + * Revision 1.31 2005/06/19 11:44:14 deva + * Cleaned up a log of logging. + * Fixed server queue (shouldn't happen). + * Added user and group lookup. + * * Revision 1.30 2005/06/16 21:28:57 deva * Rewrote thread object * Fixed bug in mov_encoder (pushed read_sem too many times, whihc lead to @@ -379,7 +384,7 @@ void MovEncoder::encode_audio(Frame *dvframe) // this runs in a thread void MovEncoder::thread_main() { - info->info("MovEncoder::run"); + info->info("MovEncoder thread is running."); FrameVector *item; Frame *in_frame; @@ -408,78 +413,17 @@ void MovEncoder::thread_main() outputqueue->push(out_frame); pthread_mutex_unlock(output_mutex); // Unlock output mutex - - // Kick frame writer - sem_post(output_sem); } delete item; - // Kick reader - sem_post(read_sem); - } - } - - info->info("MovEncoder::stop"); -} - -/* -void MovEncoder::thread_main() -{ - info->info("MovEncoder::run"); - - FrameVector *item; - Frame *in_frame; - Frame *out_frame; - - while(running) { - sem_wait(input_sem); - - // Lock inout mutex - pthread_mutex_lock(input_mutex); - if(inputqueue->size() == 0) { - info->warn("Empty queue in MovEncoder (This should not happen)."); - pthread_mutex_unlock(input_mutex); - // Kick reader - sem_post(read_sem); - continue; - } - item = inputqueue->front(); - inputqueue->pop(); - pthread_mutex_unlock(input_mutex); - // Unlock input mutex + // Kick frame writer + sem_post(output_sem); - if(!item) { - info->warn("Empty block detected (This should not happen)."); // Kick reader sem_post(read_sem); - continue; } - - for(unsigned int cnt = 0; cnt < item->size(); cnt++) { - in_frame = item->at(cnt); - out_frame = encode(in_frame); - out_frame->number = in_frame->number; - - delete in_frame; - - // Lock output mutex - pthread_mutex_lock(output_mutex); - outputqueue->push(out_frame); - pthread_mutex_unlock(output_mutex); - // Unlock output mutex - - // Kick frame writer - sem_post(output_sem); - } - - delete item; - - // Kick reader - sem_post(read_sem); } - info->info("MovEncoder::stop"); + info->info("MovEncoder thread has stopped."); } - - */ -- cgit v1.2.3