diff options
-rw-r--r-- | src/decoder.cc | 2 | ||||
-rw-r--r-- | src/encoder.cc | 3 | ||||
-rw-r--r-- | src/player.cc | 1 | ||||
-rw-r--r-- | 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; @@ -57,6 +59,13 @@ class Queue { }; template<typename T> +Queue<T>::plength() +{ + fprintf(stderr, "[ql: %d]", count); + fflush(stderr); +} + +template<typename T> Queue<T>::Queue(int glimit) { limit = glimit; |