diff options
author | MaPePeR <MaPePeR@users.noreply.github.com> | 2018-06-01 14:10:54 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-06-04 14:21:19 +0200 |
commit | ee29f6dbd130f26ed51b7a94b34790ba4c039089 (patch) | |
tree | 8d46ae6451f1f61dee3b78af2096b6e34365a93a /src/odr-audioenc.cpp | |
parent | 510b1edfd400752f91957e058fd6e009ed694d92 (diff) | |
download | ODR-AudioEnc-ee29f6dbd130f26ed51b7a94b34790ba4c039089.tar.gz ODR-AudioEnc-ee29f6dbd130f26ed51b7a94b34790ba4c039089.tar.bz2 ODR-AudioEnc-ee29f6dbd130f26ed51b7a94b34790ba4c039089.zip |
Check if overruns occured even when drift compensation is not turned on
(cherry picked from commit 15610351b76113f1026e4ad40ec7ba9926d09498)
Diffstat (limited to 'src/odr-audioenc.cpp')
-rw-r--r-- | src/odr-audioenc.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/odr-audioenc.cpp b/src/odr-audioenc.cpp index da9b93a..b5f7b9f 100644 --- a/src/odr-audioenc.cpp +++ b/src/odr-audioenc.cpp @@ -1099,9 +1099,16 @@ int main(int argc, char *argv[]) const int timeout_ms = 10000; read_bytes = input_buf.size(); + size_t overruns = 0; + /*! pop_wait() must return after a timeout, otherwise the silence detector cannot do * its job. */ - size_t bytes_from_queue = queue.pop_wait(&input_buf[0], read_bytes, timeout_ms); // returns bytes + size_t bytes_from_queue = queue.pop_wait(&input_buf[0], read_bytes, timeout_ms, &overruns); // returns bytes + + if (overruns) { + fprintf(stderr, "%zd overruns occured!\n", overruns); + status |= STATUS_OVERRUN; + } if (bytes_from_queue < read_bytes) { // queue timeout occurred |