summaryrefslogtreecommitdiff
path: root/src/multiplexer.cc
diff options
context:
space:
mode:
authordeva <deva>2005-09-18 12:52:16 +0000
committerdeva <deva>2005-09-18 12:52:16 +0000
commita37c83d8c536ef6dd53b130e92022b04e8559f5b (patch)
treefd08ba4bb2c339b4998437e43d620083c33cf60a /src/multiplexer.cc
parentc5ab3a0ea0dfe35dd1927c2ca3c9f27be9db2ebd (diff)
*** empty log message ***
Diffstat (limited to 'src/multiplexer.cc')
-rw-r--r--src/multiplexer.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/multiplexer.cc b/src/multiplexer.cc
index a94c150..323b33c 100644
--- a/src/multiplexer.cc
+++ b/src/multiplexer.cc
@@ -125,21 +125,31 @@ int Multiplexer::read_stream(char *buf, unsigned int size, StreamType type)
// Lock output mutex
pthread_mutex_lock( mutex[type] );
tmpframe = queue[type]->top();
+
if(tmpframe && tmpframe->number == frame_number[type] ) {
queue[type]->pop();
frame[type] = tmpframe;
frame_number[type]++;
read[type] = 0;
}
+ /*
if(*running == false && frame[type] == NULL) {
pthread_mutex_unlock( mutex[type] );
//info->info("Bailed out early %d!", copied);
return copied;
}
+ */
+
pthread_mutex_unlock( mutex[type] );
// Unlock output mutex
}
+ // check for end of stream
+ if( frame[type] == endOfFrameStream ) {
+ info->info("endOfFrameStream in Multiplexer %s-stream.", type==TYPE_VIDEO?"video\0":"audio\0");
+ return copied;
+ }
+
// If a frame exists in the buffer copy it to the output buffer
// (No frame ocurres when *running is set to false)
if( frame[type] ) {
@@ -455,6 +465,7 @@ void Multiplexer::multiplex()
char buf[1024];
do {
frmsz = read_stream(buf, sizeof(buf), BYPASS);
+ info->info("Wrote %d bytes", frmsz);
file->Write(buf, frmsz);
} while(frmsz == sizeof(buf));
return;