From 503281c37f5a9b473f51957576b821a29984c3c5 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 21 Apr 2020 15:56:01 +0200 Subject: Handle multi-output ZMQ + EDI --- src/odr-sourcecompanion.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/odr-sourcecompanion.cpp b/src/odr-sourcecompanion.cpp index b233e2c..4ddce24 100644 --- a/src/odr-sourcecompanion.cpp +++ b/src/odr-sourcecompanion.cpp @@ -506,12 +506,13 @@ int main(int argc, char *argv[]) read_bytes = numOutBytes; if (numOutBytes != 0) { - bool success = false; + bool success = true; if (zmq_output) { zmq_output->update_audio_levels(peak_left, peak_right); - success = zmq_output->write_frame(outbuf.data(), numOutBytes); + success &= zmq_output->write_frame(outbuf.data(), numOutBytes); } - else if (edi_output.enabled()) { + + if (edi_output.enabled()) { edi_output.update_audio_levels(peak_left, peak_right); // STI/EDI specifies that one AF packet must contain 24ms worth of data, // therefore we must split the superframe into five parts @@ -521,7 +522,7 @@ int main(int argc, char *argv[]) const size_t blocksize = numOutBytes/5; for (size_t i = 0; i < 5; i++) { - success = edi_output.write_frame(outbuf.data() + i * blocksize, blocksize); + success &= edi_output.write_frame(outbuf.data() + i * blocksize, blocksize); if (not success) { break; } -- cgit v1.2.3