From 5298cdacd41efbf2ffd0282b14e401734b31d90a Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 19 Sep 2005 09:23:50 +0000 Subject: *** empty log message *** --- src/mov_encoder.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/mov_encoder.cc') diff --git a/src/mov_encoder.cc b/src/mov_encoder.cc index 09e6fa3..3d30bbb 100644 --- a/src/mov_encoder.cc +++ b/src/mov_encoder.cc @@ -80,8 +80,8 @@ MovEncoder::~MovEncoder() // this runs in a thread void MovEncoder::thread_main() { - info->info("MovEncoder thread is running."); - static volatile int test = 0; + info->info("MovEncoder::run"); + // static volatile int test = 0; int v_outsize = 0; int a_outsize = 0; int insize = 0; @@ -115,8 +115,13 @@ void MovEncoder::thread_main() // Check for end of stream if(in_frame->endOfFrameStream == true) { info->info("endOfFrameStream in MovEncoder"); - // Stop running + + // Signal to stop running *running = false; + + // Kick them sleepy ones so they get the message. + int threads = config->readInt("encoding_threads"); + for(int cnt = 0; cnt < threads; cnt++) sem_post(input_sem); } // Encode video out_v_frame = fame.encode(in_frame); @@ -149,20 +154,20 @@ void MovEncoder::thread_main() delete item; item = NULL; - + /* test++; if(test % (25 * 24) == 0) info->info("Input pool size: %d, video output pool size: %d, audio output pool size: %d", insize, v_outsize, a_outsize); - + */ // Kick reader sem_post(read_sem); } } - + /* info->info("Input pool size: %d, video output pool size: %d, audio output pool size: %d", insize, v_outsize, a_outsize); - + */ // Kick audio encoder sem_post(audio_output_sem); @@ -170,5 +175,5 @@ void MovEncoder::thread_main() // Kick multiplexer (video) sem_post(video_output_sem); - info->info("MovEncoder thread has stopped."); + info->info("MovEncoder::stop"); } -- cgit v1.2.3