diff options
author | deva <deva> | 2005-09-17 16:36:25 +0000 |
---|---|---|
committer | deva <deva> | 2005-09-17 16:36:25 +0000 |
commit | c5ab3a0ea0dfe35dd1927c2ca3c9f27be9db2ebd (patch) | |
tree | f06cebe8376048e1ccf1052a91fe940ea5c4f2e9 /src/mov_encoder.cc | |
parent | 4a5060ae3ebc42fad95f6ef7ec9c205a09116067 (diff) |
*** empty log message ***R0_2_7
Diffstat (limited to 'src/mov_encoder.cc')
-rw-r--r-- | src/mov_encoder.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/mov_encoder.cc b/src/mov_encoder.cc index 4e8189c..118a338 100644 --- a/src/mov_encoder.cc +++ b/src/mov_encoder.cc @@ -97,13 +97,14 @@ void MovEncoder::thread_main() LibFAMEWrapper fame(info); // LibLAMEWrapper lame(info); - while(running) { - sem_wait(input_sem); - // Make a new instance for every frame sequence (usually 5) to ensure no // frame dependencies are broken when running multithreaded. LibLAMEWrapper lame(info); + while(running) { + sem_wait(input_sem); + + // Lock inout mutex pthread_mutex_lock(input_mutex); item = inputqueue->front(); @@ -119,16 +120,19 @@ void MovEncoder::thread_main() in_frame = item->at(cnt); // Encode video - out_v_frame = new Frame(in_frame->data, in_frame->size); - out_v_frame->number = in_frame->number; + //out_v_frame = new Frame(in_frame->data, in_frame->size); + //out_v_frame->number = in_frame->number; out_v_frame = fame.encode(in_frame); out_v_frame->number = in_frame->number; // Encode audio - out_a_frame = new Frame(in_frame->data, in_frame->size); - out_a_frame->number = in_frame->number; + //out_a_frame = new Frame(in_frame->data, in_frame->size); + //out_a_frame->number = in_frame->number; out_a_frame = lame.encode(in_frame); out_a_frame->number = in_frame->number; + + // Last frame - we need to close LAME + // if(cnt == item->size() - 1) out_a_frame = lame.close(out_a_frame); delete in_frame; |