From 9bf9469ccdc037d26ccd69ac9e81e64d74fc7008 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 12 May 2017 09:47:01 +0200 Subject: Handle absence of cifPoly in flowgraph setup --- src/DabModulator.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/DabModulator.cpp') diff --git a/src/DabModulator.cpp b/src/DabModulator.cpp index d425f04..4e0bc33 100644 --- a/src/DabModulator.cpp +++ b/src/DabModulator.cpp @@ -367,27 +367,33 @@ int DabModulator::process(Buffer* dataOut) myFlowgraph->connect(cifOfdm, cifGain); myFlowgraph->connect(cifGain, cifGuard); + auto cifOut = cifPoly ? + static_pointer_cast(cifPoly) : + static_pointer_cast(myOutput); + if (cifFilter) { myFlowgraph->connect(cifGuard, cifFilter); if (cifRes) { myFlowgraph->connect(cifFilter, cifRes); - myFlowgraph->connect(cifRes, cifPoly); + myFlowgraph->connect(cifRes, cifOut); } else { - myFlowgraph->connect(cifFilter, cifPoly); + myFlowgraph->connect(cifFilter, cifOut); } } else { if (cifRes) { myFlowgraph->connect(cifGuard, cifRes); - myFlowgraph->connect(cifRes, cifPoly); + myFlowgraph->connect(cifRes, cifOut); } else { - myFlowgraph->connect(cifGuard, cifPoly); + myFlowgraph->connect(cifGuard, cifOut); } } - myFlowgraph->connect(cifPoly, myOutput); + if (cifPoly) { + myFlowgraph->connect(cifPoly, myOutput); + } } //////////////////////////////////////////////////////////////////// -- cgit v1.2.3