aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-04-01 09:02:20 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-04-01 09:02:20 +0200
commitb04e8d19d684479b4a5c096789ead96f4b1a60ee (patch)
tree09e1467f166e0bf706b18828a7da335370b4c410
parent1bd73b6ad1da401e71fe784c173f374930979829 (diff)
downloadODR-AudioEnc-b04e8d19d684479b4a5c096789ead96f4b1a60ee.tar.gz
ODR-AudioEnc-b04e8d19d684479b4a5c096789ead96f4b1a60ee.tar.bz2
ODR-AudioEnc-b04e8d19d684479b4a5c096789ead96f4b1a60ee.zip
Fix usage of queue.pop returnvalue for drift compensation
-rw-r--r--src/dabplus-enc.cpp10
1 files changed, 6 insertions, 4 deletions
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;
}