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.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mov_encoder.cc b/src/mov_encoder.cc
index 3945040..d422f87 100644
--- a/src/mov_encoder.cc
+++ b/src/mov_encoder.cc
@@ -39,6 +39,9 @@
/*
* $Log$
+ * Revision 1.29 2005/06/14 18:58:35 deva
+ * *** empty log message ***
+ *
* Revision 1.28 2005/06/14 12:29:40 deva
* Incorporated the use of the Info object everywhere... also using the log functionality.
*
@@ -119,6 +122,7 @@ MovEncoder::MovEncoder(sem_t *r_sem,
Info *i)
{
info = i;
+ info->info("MovEncoder");
// FIXME: Hmmm... should this be detected somewhere?!
int w = 720;
@@ -260,6 +264,7 @@ MovEncoder::MovEncoder(sem_t *r_sem,
MovEncoder::~MovEncoder()
{
+ info->info("~MovEncoder");
/*
if(f) { // The file was opened.
int written = fame_close(fame_context);
@@ -367,19 +372,22 @@ void MovEncoder::encode_audio(Frame *dvframe)
// this runs in a thread
void MovEncoder::run()
{
+ info->info("MovEncoder::run");
+
FrameVector *item;
Frame *in_frame;
Frame *out_frame;
- // fprintf(stderr, "\t\t\t\tEncoder Ready\n"); fflush(stderr);
-
while(running) {
sem_wait(input_sem);
- // fprintf(stderr, "\t\t\t\tReading block\n"); fflush(stderr);
-
// Lock inout mutex
pthread_mutex_lock(input_mutex);
+ if(inputqueue->size() == 0) {
+ info->error("Dammit... Empty queue in MovEncoder.");
+ pthread_mutex_unlock(input_mutex);
+ continue;
+ }
item = inputqueue->front();
inputqueue->pop();
pthread_mutex_unlock(input_mutex);
@@ -402,8 +410,6 @@ void MovEncoder::run()
outputqueue->push(out_frame);
pthread_mutex_unlock(output_mutex);
// Unlock output mutex
-
- // fprintf(stderr, "\t\t\t\tEncoded [%d] - pushed it for writing\n", in_frame->number); fflush(stderr);
}
delete item;
@@ -411,4 +417,6 @@ void MovEncoder::run()
sem_post(read_sem);
sem_post(output_sem);
}
+
+ info->info("MovEncoder::stop");
}