From fdc9c2bdd04302b5c3a72f1bd0fd8f5880c08fc2 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 6 Aug 2018 11:43:42 +0200 Subject: Fix truncation of output data when decoder is used --- src/odr-sourcecompanion.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/odr-sourcecompanion.cpp b/src/odr-sourcecompanion.cpp index b687105..bbcb310 100644 --- a/src/odr-sourcecompanion.cpp +++ b/src/odr-sourcecompanion.cpp @@ -406,10 +406,8 @@ int main(int argc, char *argv[]) if (numOutBytes % 120 != 0) { throw runtime_error("Invalid data length " + to_string(numOutBytes)); } - numOutBytes /= 120; - numOutBytes *= 110; - decoder.decode_frame(outbuf.data(), numOutBytes); + decoder.decode_frame(outbuf.data(), numOutBytes / 120 * 110); auto p = decoder.get_peaks(); peak_left = p.peak_left; -- cgit v1.2.3