From 44b50125cef0aecfbad01058f771924bf1e16512 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Sat, 2 Oct 2021 12:05:15 +0200 Subject: Initialise snoop subchannel index --- src/dabplussnoop.cpp | 4 ++-- src/dabplussnoop.hpp | 3 ++- src/etianalyse.cpp | 3 +-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/dabplussnoop.cpp b/src/dabplussnoop.cpp index 3e55072..f0e0d8b 100644 --- a/src/dabplussnoop.cpp +++ b/src/dabplussnoop.cpp @@ -330,14 +330,14 @@ StreamSnoop::~StreamSnoop() void StreamSnoop::push(uint8_t* streamdata, size_t streamsize) { - if (subchid == -1) { + if (m_subchid == -1) { throw logic_error("StreamSnoop not properly initialised"); } // First dump to subchannel file (superframe+parity word) if (m_dump_to_file and m_raw_data_stream_fd == nullptr) { stringstream dump_filename; - dump_filename << "stream-" << subchid << ".dab"; + dump_filename << "stream-" << m_subchid << ".dab"; m_raw_data_stream_fd = fopen(dump_filename.str().c_str(), "w"); diff --git a/src/dabplussnoop.hpp b/src/dabplussnoop.hpp index cc91f46..5efb194 100644 --- a/src/dabplussnoop.hpp +++ b/src/dabplussnoop.hpp @@ -125,6 +125,7 @@ class StreamSnoop { public: StreamSnoop(int subchid, bool dump_to_file) : dps(), + m_subchid(subchid), m_raw_data_stream_fd(nullptr), m_dump_to_file(dump_to_file) { dps.subchid = subchid; @@ -145,11 +146,11 @@ class StreamSnoop { audio_statistics_t get_audio_statistics(void) const; - int subchid = -1; int stream_index = -1; private: DabPlusSnoop dps; + int m_subchid = -1; FILE* m_raw_data_stream_fd; bool m_dump_to_file; }; diff --git a/src/etianalyse.cpp b/src/etianalyse.cpp index fa3f297..6e14343 100644 --- a/src/etianalyse.cpp +++ b/src/etianalyse.cpp @@ -577,8 +577,7 @@ void ETI_Analyser::eti_analyse() for (const auto& service : ensemble.services) { for (const auto& component : service.components) { - if (component.subchId == snoop.second.subchid and - component.primary) { + if (component.subchId == snoop.first and component.primary) { corresponding_service_found = true; fprintf(stat_fd, " - service_id: 0x%x\n", service.id); fprintf(stat_fd, " subchannel_id: 0x%x\n", component.subchId); -- cgit v1.2.3