]> git.sesse.net Git - nageru/commitdiff
Cut some unneccessary allocations.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 9 Nov 2017 18:49:46 +0000 (19:49 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 9 Nov 2017 18:49:46 +0000 (19:49 +0100)
print_latency.cpp
print_latency.h

index af199856e4d1c34935486584282552c7aa5fc0d9..72440ae0fe41a3ec13df76c595450ca409090aec 100644 (file)
@@ -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<double> 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");
index 3e1c4060f530a204cb419a6166f2ec675987747e..d80ac88e96a25ac04f6f64a27f921edd9c45ff59 100644 (file)
@@ -27,6 +27,6 @@ struct LatencyHistogram {
 
 ReceivedTimestamps find_received_timestamp(const std::vector<RefCountedFrame> &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)