diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-06-05 10:09:18 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-06-05 10:09:18 +0200 |
commit | 01f55e125cdc2156bb6936f70aa52d13ff40420f (patch) | |
tree | 937c4e753c618409b87ce7f4498b0c73b340b4f1 /src/InputZeroMQReader.cpp | |
parent | 23ad47277e73348bca32226d87274541e56bbebb (diff) | |
parent | c8b792fee07cfa591339cbf6f67454cb1cf4535b (diff) | |
download | dabmod-01f55e125cdc2156bb6936f70aa52d13ff40420f.tar.gz dabmod-01f55e125cdc2156bb6936f70aa52d13ff40420f.tar.bz2 dabmod-01f55e125cdc2156bb6936f70aa52d13ff40420f.zip |
Merge branch 'next' into tii
Diffstat (limited to 'src/InputZeroMQReader.cpp')
-rw-r--r-- | src/InputZeroMQReader.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/InputZeroMQReader.cpp b/src/InputZeroMQReader.cpp index 8706e1e..36d4e4b 100644 --- a/src/InputZeroMQReader.cpp +++ b/src/InputZeroMQReader.cpp @@ -86,7 +86,18 @@ int InputZeroMQReader::GetNextFrame(void* buffer) const size_t framesize = 6144; boost::shared_ptr<std::vector<uint8_t> > incoming; - in_messages_.wait_and_pop(incoming); + + /* Do some prebuffering because reads will happen in bursts + * (4 ETI frames in TM1) and we should make sure that + * we can serve the data required for a full transmission frame. + */ + if (in_messages_.size() < 4) { + const size_t prebuffering = 10; + in_messages_.wait_and_pop(incoming, prebuffering); + } + else { + in_messages_.wait_and_pop(incoming); + } if (! workerdata_.running) { throw zmq_input_overflow(); @@ -193,7 +204,7 @@ void InputZeroMQWorker::RecvProcess(struct InputZeroMQThreadData* workerdata) } if (queue_size < 5) { - etiLog.level(warn) << "ZeroMQ buffer low: " << queue_size << "elements !"; + etiLog.level(warn) << "ZeroMQ buffer low: " << queue_size << " elements !"; } } } |