From ec73adf2818b4d2bd091778bddd4cba41714d2eb Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 9 Nov 2017 19:49:46 +0100 Subject: [PATCH] Cut some unneccessary allocations. --- print_latency.cpp | 4 ++-- print_latency.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/print_latency.cpp b/print_latency.cpp index af19985..72440ae 100644 --- a/print_latency.cpp +++ b/print_latency.cpp @@ -74,7 +74,7 @@ void LatencyHistogram::init(const string &measuring_point) } } -void print_latency(const string &header, const ReceivedTimestamps &received_ts, bool is_b_frame, int *frameno, LatencyHistogram *histogram) +void print_latency(const char *header, const ReceivedTimestamps &received_ts, bool is_b_frame, int *frameno, LatencyHistogram *histogram) { if (received_ts.ts.empty()) return; @@ -120,7 +120,7 @@ void print_latency(const string &header, const ReceivedTimestamps &received_ts, duration highest_latency = now - min_ts; printf("%-60s %4.0f ms (lowest-latency input), %4.0f ms (highest-latency input)", - header.c_str(), 1e3 * lowest_latency.count(), 1e3 * highest_latency.count()); + header, 1e3 * lowest_latency.count(), 1e3 * highest_latency.count()); if (is_b_frame) { printf(" [on B-frame; potential extra latency]\n"); diff --git a/print_latency.h b/print_latency.h index 3e1c406..d80ac88 100644 --- a/print_latency.h +++ b/print_latency.h @@ -27,6 +27,6 @@ struct LatencyHistogram { ReceivedTimestamps find_received_timestamp(const std::vector &input_frames); -void print_latency(const std::string &header, const ReceivedTimestamps &received_ts, bool is_b_frame, int *frameno, LatencyHistogram *histogram); +void print_latency(const char *header, const ReceivedTimestamps &received_ts, bool is_b_frame, int *frameno, LatencyHistogram *histogram); #endif // !defined(_PRINT_LATENCY_H) -- 2.39.2