summaryrefslogtreecommitdiff
path: root/src/mov_encoder_thread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mov_encoder_thread.cc')
-rw-r--r--src/mov_encoder_thread.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/mov_encoder_thread.cc b/src/mov_encoder_thread.cc
index 4562ec9..1e8263b 100644
--- a/src/mov_encoder_thread.cc
+++ b/src/mov_encoder_thread.cc
@@ -98,12 +98,6 @@ MovEncoderThread::~MovEncoderThread()
{
info->info("~MovEncoderThread");
- // Push end of stream frame to the queue.
- num_frames_in_block = block->size() + 1; // Make the next frame fill out the block.
- encode(endOfFrameStream);
-
- info->info("Posted endOfFrameStream");
-
// First we destroy the movie encoders
for(int cnt = 0; cnt < threads; cnt++) sem_post(&in_sem); // Kick them
for(int cnt = 0; cnt < threads; cnt++) {
@@ -121,6 +115,7 @@ MovEncoderThread::~MovEncoderThread()
info->info("Deleted the audio encoder");
// Finally we destroy the writer.
+ writer->running = false;
sem_post(&video_out_sem); // Kick it to make it stop.
sem_post(&audio_out_sem); // Kick it to make it stop.
writer->wait_stop(); // Wait for it to stop.
@@ -201,7 +196,7 @@ void MovEncoderThread::encode(Frame* frame)
block->push_back(frame);
// Switch frame
- if(block->size() == num_frames_in_block) {
+ if(block->size() == num_frames_in_block || frame->endOfFrameStream == true) {
// Wait until a free encoder.
sem_wait(&read_sem);