diff options
Diffstat (limited to 'dabplussnoop.cpp')
-rw-r--r-- | dabplussnoop.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/dabplussnoop.cpp b/dabplussnoop.cpp index 5ee556e..13661ef 100644 --- a/dabplussnoop.cpp +++ b/dabplussnoop.cpp @@ -19,7 +19,7 @@ Authors: Matthias P. Braendli <matthias@mpb.li> - Mathias Coinchon <coinchon@yahoo.com> + Mathias Coinchon <coinchon@yahoo.com> */ #include <stdio.h> @@ -56,22 +56,22 @@ void DabPlusSnoop::push(uint8_t* streamdata, size_t streamsize) if (decode()) { - // First dump to subchannel file (superframe+parity word) - if (m_raw_data_stream_fd == NULL) { - stringstream dump_filename; - dump_filename << "stream-" << m_index << ".msc"; + // First dump to subchannel file (superframe+parity word) + if (m_raw_data_stream_fd == NULL) { + stringstream dump_filename; + dump_filename << "stream-" << m_index << ".msc"; - m_raw_data_stream_fd = fopen(dump_filename.str().c_str(), "w"); + m_raw_data_stream_fd = fopen(dump_filename.str().c_str(), "w"); - if (m_raw_data_stream_fd == NULL) { - perror("File open failed"); - } - } - - fwrite(&m_data[0], m_subchannel_index, 120, m_raw_data_stream_fd); + if (m_raw_data_stream_fd == NULL) { + perror("File open failed"); + } + } - // We have been able to decode the AUs, now flush vector - m_data.clear(); + fwrite(&m_data[0], m_subchannel_index, 120, m_raw_data_stream_fd); + + // We have been able to decode the AUs, now flush vector + m_data.clear(); } } } @@ -107,7 +107,7 @@ bool DabPlusSnoop::seek_valid_firecode() #if DPS_DEBUG printf(DPS_PREFIX " Found valid FireCode at %zu\n", i); #endif - //erase elements before the header + //erase elements before the header m_data.erase(m_data.begin(), m_data.begin() + i); return true; } @@ -291,8 +291,8 @@ bool DabPlusSnoop::extract_au(vector<int> au_start) return analyse_au(aus); } else { - //discard faulty superframe (to be improved to correct/conceal) - m_data.clear(); + //discard faulty superframe (to be improved to correct/conceal) + m_data.clear(); return false; } } |