From a37c83d8c536ef6dd53b130e92022b04e8559f5b Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 18 Sep 2005 12:52:16 +0000 Subject: *** empty log message *** --- src/multiplexer.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/multiplexer.cc') 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; -- cgit v1.2.3