aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/VLCInput.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/VLCInput.cpp b/src/VLCInput.cpp
index a370c78..99f86f1 100644
--- a/src/VLCInput.cpp
+++ b/src/VLCInput.cpp
@@ -186,9 +186,8 @@ ssize_t VLCInput::m_read(uint8_t* buf, size_t length)
boost::mutex::scoped_lock lock(m_queue_mutex);
if (m_queue.size() >= length) {
- for (size_t i = 0; i < length; i++) {
- buf[i] = m_queue[i];
- }
+ std::copy(m_queue.begin(), m_queue.begin() + length, buf);
+
m_queue.erase(m_queue.begin(), m_queue.begin() + length);
return length;