aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dabplussnoop.cpp4
-rw-r--r--src/dabplussnoop.hpp9
2 files changed, 11 insertions, 2 deletions
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<vector<uint8_t> >& 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);