From ea355c46d1e57cb06384e7418bb0b3e539e36852 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 7 Jul 2017 12:24:54 +0200 Subject: Do not write wav files in statistics mode --- src/dabplussnoop.cpp | 4 +++- src/dabplussnoop.hpp | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dabplussnoop.cpp b/src/dabplussnoop.cpp index 228016d..f6bb8ac 100644 --- a/src/dabplussnoop.cpp +++ b/src/dabplussnoop.cpp @@ -299,7 +299,9 @@ bool DabPlusSnoop::analyse_au(vector >& aus) { stringstream ss_filename; - ss_filename << "stream-" << m_index; + if (m_write_to_wav_file) { + ss_filename << "stream-" << m_index; + } if (!m_faad_decoder.is_initialised()) { m_faad_decoder.open(ss_filename.str(), m_ps_flag, diff --git a/src/dabplussnoop.hpp b/src/dabplussnoop.hpp index cb7d9ec..6619436 100644 --- a/src/dabplussnoop.hpp +++ b/src/dabplussnoop.hpp @@ -89,6 +89,10 @@ class DabPlusSnoop m_subchannel_index = subchannel_index; } + void enable_wav_file_output(bool enable) { + m_write_to_wav_file = enable; + } + void set_index(int index) { m_index = index; @@ -102,6 +106,7 @@ class DabPlusSnoop /* Data needed for FAAD */ FaadDecoder m_faad_decoder; int m_index; + bool m_write_to_wav_file; bool m_ps_flag; bool m_aac_channel_mode; @@ -129,7 +134,9 @@ class StreamSnoop dps(), m_index(-1), m_raw_data_stream_fd(nullptr), - m_dump_to_file(dump_to_file) {} + m_dump_to_file(dump_to_file) { + dps.enable_wav_file_output(dump_to_file); + } ~StreamSnoop(); StreamSnoop(StreamSnoop&& other); -- cgit v1.2.3