From 617a90f67fe2f768fa0ce7002623e43581865837 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 26 Apr 2005 10:17:04 +0000 Subject: *** empty log message *** --- src/decoder.cc | 2 +- src/encoder.cc | 3 ++- src/player.cc | 1 + src/queue.h | 9 +++++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/decoder.cc b/src/decoder.cc index cd5806f..8f95727 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -90,11 +90,11 @@ void Decoder::decode() // Kick the others so they wake up with empty queues sem_post(encode_sem); - pthread_exit(NULL); } void Decoder::run() { decode(); + fprintf(stderr, "Decoder thread stopped.\n"); fflush(sdterr); } #endif /*USE_GUI*/ diff --git a/src/encoder.cc b/src/encoder.cc index 1664588..ef575e7 100644 --- a/src/encoder.cc +++ b/src/encoder.cc @@ -75,6 +75,7 @@ void Encoder::encode() pthread_mutex_lock(mutex); frame = queue->pop(); + queue->plength(); pthread_mutex_unlock(mutex); if((frame && record) || @@ -96,7 +97,6 @@ void Encoder::encode() } if(frame) delete frame; } - // pthread_exit(NULL); } @@ -130,6 +130,7 @@ void Encoder::shoot() void Encoder::run() { encode(); + fprintf(stderr, "Encoder thread stopped.\n"); fflush(sdterr); } diff --git a/src/player.cc b/src/player.cc index 8492d42..54112c4 100644 --- a/src/player.cc +++ b/src/player.cc @@ -193,6 +193,7 @@ void Player::player() void Player::run() { player(); + fprintf(stderr, "Player thread stopped.\n"); fflush(sdterr); } void Player::start() diff --git a/src/queue.h b/src/queue.h index 7352071..c9c0641 100644 --- a/src/queue.h +++ b/src/queue.h @@ -48,6 +48,8 @@ class Queue { void push(T *t); T *pop(); + void plength(); + private: int limit; buf_t *head; @@ -56,6 +58,13 @@ class Queue { pthread_mutex_t mutex; }; +template +Queue::plength() +{ + fprintf(stderr, "[ql: %d]", count); + fflush(stderr); +} + template Queue::Queue(int glimit) { -- cgit v1.2.3