summaryrefslogtreecommitdiff
path: root/src/mov_encoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mov_encoder.cc')
-rw-r--r--src/mov_encoder.cc21
1 files changed, 13 insertions, 8 deletions
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");
}