summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2005-04-26 10:17:04 +0000
committerdeva <deva>2005-04-26 10:17:04 +0000
commit617a90f67fe2f768fa0ce7002623e43581865837 (patch)
tree8a6be27dc165b9a4aa9d923b8d504e541deb605b
parent0ffc2529d674a71a794effaa0975364c219f9115 (diff)
*** empty log message ***
-rw-r--r--src/decoder.cc2
-rw-r--r--src/encoder.cc3
-rw-r--r--src/player.cc1
-rw-r--r--src/queue.h9
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;