diff options
Diffstat (limited to 'src/OutputFile.cpp')
-rw-r--r-- | src/OutputFile.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/OutputFile.cpp b/src/OutputFile.cpp index b7bf59a..f5a1997 100644 --- a/src/OutputFile.cpp +++ b/src/OutputFile.cpp @@ -36,9 +36,9 @@ using namespace std; -OutputFile::OutputFile(std::string filename) : - ModOutput(), - ModMetadata(), +OutputFile::OutputFile(const std::string& filename, bool show_metadata) : + ModOutput(), ModMetadata(), + myShowMetadata(show_metadata), myFilename(filename) { PDEBUG("OutputFile::OutputFile(filename: %s) @ %p\n", @@ -69,31 +69,33 @@ int OutputFile::process(Buffer* dataIn) meta_vec_t OutputFile::process_metadata(const meta_vec_t& metadataIn) { - stringstream ss; - - for (const auto& md : metadataIn) { - if (md.ts) { - ss << " FCT=" << md.ts->fct << - " FP=" << (int)md.ts->fp; - if (md.ts->timestamp_valid) { - ss << " TS=" << md.ts->timestamp_sec << ";"; + if (myShowMetadata) { + stringstream ss; + + for (const auto& md : metadataIn) { + if (md.ts) { + ss << " FCT=" << md.ts->fct << + " FP=" << (int)md.ts->fp; + if (md.ts->timestamp_valid) { + ss << " TS=" << md.ts->timestamp_sec << ";"; + } + else { + ss << " No TS;"; + } } else { - ss << " No TS;"; + ss << " void, "; } } + + if (metadataIn.empty()) { + etiLog.level(debug) << "Output File got no mdIn"; + } else { - ss << " void, "; + etiLog.level(debug) << "Output File got metadata: " << ss.str(); } - } - if (metadataIn.empty()) { - etiLog.level(debug) << "Output File got no mdIn"; } - else { - etiLog.level(debug) << "Output File got metadata: " << ss.str(); - } - return {}; } |