From 4f7cddbb9bc9985c3c1632f8c5e217e49a59ea3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oona=20R=C3=A4is=C3=A4nen?= Date: Thu, 27 Jun 2024 19:41:30 +0300 Subject: [PATCH] Add debian:buster workflow to CI --- .github/workflows/build.yml | 17 ++++++++++++++++- src/redsea.cc | 12 ++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e17317..86fe63c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: build on: push: - branches: [ master ] + branches: [ master, dev ] tags: [ 'v*' ] pull_request: branches: [ master ] @@ -39,6 +39,21 @@ jobs: #- name: Install .deb # run: dpkg -i ../redsea_*.deb + build-debian-oldoldstable: + runs-on: ubuntu-latest + container: debian:buster + + steps: + - uses: actions/checkout@v4 + - name: Install dependencies (apt-get) + run: apt-get update && apt-get -y install meson build-essential libsndfile1-dev libliquid-dev nlohmann-json3-dev + - name: meson setup + run: meson setup -Dwerror=true build + - name: compile + run: cd build && meson compile + - name: test + run: cd build && meson test + macos-build: runs-on: macos-latest diff --git a/src/redsea.cc b/src/redsea.cc index 58d859f..12ca917 100644 --- a/src/redsea.cc +++ b/src/redsea.cc @@ -128,26 +128,26 @@ int processMPXInput(Options options) { auto& output_stream = options.feed_thru ? std::cerr : std::cout; - std::vector channels; + std::vector> channels; std::vector> subcarriers; for (uint32_t i = 0; i < options.num_channels; i++) { - channels.emplace_back(options, i, output_stream); + channels.emplace_back(std::make_unique(options, i, output_stream)); subcarriers.push_back(std::make_unique(options)); } while (!mpx.eof()) { mpx.fillBuffer(); for (uint32_t i = 0; i < options.num_channels; i++) { - channels[i].processBits(subcarriers[i]->processChunk(mpx.readChunk(i))); - if (channels[i].getSecondsSinceCarrierLost() > 10.f && + channels[i]->processBits(subcarriers[i]->processChunk(mpx.readChunk(i))); + if (channels[i]->getSecondsSinceCarrierLost() > 10.f && subcarriers[i]->getSecondsSinceLastReset() > 5.f) { subcarriers[i]->reset(); - channels[i].resetPI(); + channels[i]->resetPI(); } } } - for (uint32_t i = 0; i < options.num_channels; i++) channels[i].flush(); + for (uint32_t i = 0; i < options.num_channels; i++) channels[i]->flush(); return EXIT_SUCCESS; }