summaryrefslogtreecommitdiffstats
path: root/src/DabMod.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-05-16 11:48:42 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-05-16 11:48:42 +0200
commit0226ed393837e753d4afe0349c28263d3c406f90 (patch)
treecbbccff057f02b579413e9d3223d155015509b76 /src/DabMod.cpp
parent1c110d11ae3d3181ed37c941fa7e622d332eb520 (diff)
downloaddabmod-0226ed393837e753d4afe0349c28263d3c406f90.tar.gz
dabmod-0226ed393837e753d4afe0349c28263d3c406f90.tar.bz2
dabmod-0226ed393837e753d4afe0349c28263d3c406f90.zip
Handle Ctrl-C when using EDI input
Diffstat (limited to 'src/DabMod.cpp')
-rw-r--r--src/DabMod.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index bc32b9d..e388b15 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -330,14 +330,21 @@ int launch_modulator(int argc, char* argv[])
bool first_frame = true;
while (running) {
- while (not ediReader.isFrameReady()) {
- bool success = ediUdpInput.rxPacket();
- if (not success) {
+ while (running and not ediReader.isFrameReady()) {
+ try {
+ ediUdpInput.rxPacket();
+ }
+ catch (std::runtime_error& e) {
+ etiLog.level(warn) << "EDI input: " << e.what();
running = 0;
break;
}
}
+ if (not running) {
+ break;
+ }
+
if (first_frame) {
if (ediReader.getFp() != 0) {
// Do not start the flowgraph before we get to FP 0