From b04e8d19d684479b4a5c096789ead96f4b1a60ee Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 1 Apr 2016 09:02:20 +0200 Subject: Fix usage of queue.pop returnvalue for drift compensation --- src/dabplus-enc.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/dabplus-enc.cpp b/src/dabplus-enc.cpp index 1b351aa..5b2df47 100644 --- a/src/dabplus-enc.cpp +++ b/src/dabplus-enc.cpp @@ -910,9 +910,10 @@ int main(int argc, char *argv[]) } size_t overruns; - read_bytes = queue.pop(&input_buf[0], input_buf.size(), &overruns); // returns bytes + size_t bytes_from_queue = queue.pop(&input_buf[0], input_buf.size(), &overruns); // returns bytes + read_bytes = input_buf.size(); - if (read_bytes != input_buf.size()) { + if (bytes_from_queue != input_buf.size()) { status |= STATUS_UNDERRUN; } @@ -949,9 +950,10 @@ int main(int argc, char *argv[]) #endif size_t overruns; - read_bytes = queue.pop(&input_buf[0], input_buf.size(), &overruns); // returns bytes + size_t bytes_from_queue = queue.pop(&input_buf[0], input_buf.size(), &overruns); // returns bytes + read_bytes = input_buf.size(); - if (read_bytes != input_buf.size()) { + if (bytes_from_queue != input_buf.size()) { status |= STATUS_UNDERRUN; } -- cgit v1.2.3