From: Steinar H. Gunderson Date: Thu, 9 Nov 2017 18:49:46 +0000 (+0100) Subject: Cut some unneccessary allocations. X-Git-Tag: 1.6.4~7 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=ec73adf2818b4d2bd091778bddd4cba41714d2eb Cut some unneccessary allocations. --- 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)