Small fix in queue cleanup

This commit is contained in:
badaix 2020-02-28 08:15:14 +01:00
parent 3f0a18f8b5
commit 0956a24d2e

View file

@ -149,7 +149,7 @@ void StreamSession::sendAsync(shared_const_buffer const_buf, bool send_now)
{ {
strand_.post([ this, self = shared_from_this(), const_buf, send_now ]() { strand_.post([ this, self = shared_from_this(), const_buf, send_now ]() {
// delete PCM chunks that are older than the overall buffer duration // delete PCM chunks that are older than the overall buffer duration
messages_.erase(std::remove_if(messages_.begin() + 1, messages_.end(), messages_.erase(std::remove_if(messages_.begin(), messages_.end(),
[this](const shared_const_buffer& buffer) { [this](const shared_const_buffer& buffer) {
const auto& msg = buffer.message(); const auto& msg = buffer.message();
if (!msg.is_pcm_chunk || buffer.on_air) if (!msg.is_pcm_chunk || buffer.on_air)