From 55173c476b0b2703abd066379d82adc139d9b946 Mon Sep 17 00:00:00 2001
From: Tim Retout <tim@retout.co.uk>
Date: Sun, 14 Nov 2010 00:03:13 +0000
Subject: [PATCH] Use C++ std::clock() for RTMP uptime on non-Amiga systems.

On Linux 2.6, times(2) uses an arbitrary point in the past for the
epoch, and this led to the extended RTMP timestamp always being used.

Also multiply std::clock() by 1000 rather than 100 to get a time in
milliseconds.

Signed-off-by: Tim Retout <tim@retout.co.uk>
---
 libbase/RTMP.cpp |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/libbase/RTMP.cpp b/libbase/RTMP.cpp
index c29e031..2eb1ece 100644
--- a/libbase/RTMP.cpp
+++ b/libbase/RTMP.cpp
@@ -1262,14 +1262,11 @@ encodeInt32(boost::uint8_t *output, boost::uint8_t *outend, int nVal)
 boost::uint32_t
 getUptime()
 {
-#if !defined(_WIN32) && !defined(__amigaos4__)
-    struct tms t;
-    return times(&t) * 1000 / sysconf(_SC_CLK_TCK);
-#elif defined(__amigaos4__)
+#if defined(__amigaos4__)
     struct tms t;
     return times(&t) * 1000 / 50;
 #else
-    return std::clock() * 100 / CLOCKS_PER_SEC;   
+    return std::clock() * 1000 / CLOCKS_PER_SEC;
 #endif
 }
 
-- 
1.7.2.3

