aboutsummaryrefslogtreecommitdiffstats
path: root/src/AVTInput.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-06-26 10:57:58 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-06-26 10:57:58 +0200
commit8e7a15754a3fef09cc5de372f207936740459c56 (patch)
treef1c3cc289eebc9ed9b620696b24467680288cc39 /src/AVTInput.cpp
parent899dcb83ec873cb35d38583d6f48922e1312e9be (diff)
downloadODR-SourceCompanion-8e7a15754a3fef09cc5de372f207936740459c56.tar.gz
ODR-SourceCompanion-8e7a15754a3fef09cc5de372f207936740459c56.tar.bz2
ODR-SourceCompanion-8e7a15754a3fef09cc5de372f207936740459c56.zip
Refactor OrderedQueue a bit
Diffstat (limited to 'src/AVTInput.cpp')
-rw-r--r--src/AVTInput.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/AVTInput.cpp b/src/AVTInput.cpp
index 973ed7b..0e5b669 100644
--- a/src/AVTInput.cpp
+++ b/src/AVTInput.cpp
@@ -69,9 +69,7 @@ AVTInput::AVTInput(const std::string& input_uri,
_input_pad_packet(2048),
_ordered(5000, _jitterBufferSize),
_lastInfoFrameType(_typeCantExtract)
-{
-
-}
+{ }
int AVTInput::prepare(void)
{
@@ -430,14 +428,13 @@ ssize_t AVTInput::getNextFrame(std::vector<uint8_t> &buf)
//printf("B: _padFrameQueue size=%zu\n", _padFrameQueue.size());
// Assemble next frame
- int32_t nb = 0;
std::vector<uint8_t> part;
- while (_nbFrames < 5 && (nb = _ordered.pop(part)) != 0)
+ while (_nbFrames < 5 and not (part = _ordered.pop()).empty())
{
while (_checkMessage());
- memcpy(_currentFrame.data() + _currentFrameSize, part.data(), nb);
- _currentFrameSize += nb;
+ memcpy(_currentFrame.data() + _currentFrameSize, part.data(), part.size());
+ _currentFrameSize += part.size();
_nbFrames ++;
}