From 38dcdcae98d3ac2ce05ac72afc419616a66a2ff2 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 24 Sep 2014 18:48:07 +0200 Subject: [PATCH] GCC 4.6 compat --- src/hd-rum-translator/hd-rum-recompress.cpp | 15 +++++++++------ src/utils/video_frame_pool.h | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/hd-rum-translator/hd-rum-recompress.cpp b/src/hd-rum-translator/hd-rum-recompress.cpp index a18717a80..a87d3c1bc 100644 --- a/src/hd-rum-translator/hd-rum-recompress.cpp +++ b/src/hd-rum-translator/hd-rum-recompress.cpp @@ -18,10 +18,15 @@ using namespace std; struct state_recompress { + state_recompress(unique_ptr && vr, string const & h, int tp) + : video_rxtx(std::move(vr)), host(h), t0(chrono::system_clock::now()), + frames(0), tx_port(tp) { + } + unique_ptr video_rxtx; string host; - chrono::steady_clock::time_point t0; + chrono::system_clock::time_point t0; int frames; int tx_port; }; @@ -56,13 +61,11 @@ void *recompress_init(struct module *parent, params["decoder_mode"].l = VIDEO_NORMAL; params["display_device"].ptr = NULL; - return new state_recompress{ + return new state_recompress( decltype(state_recompress::video_rxtx)(dynamic_cast(video_rxtx::create(ULTRAGRID_RTP, params))), host, - chrono::steady_clock::now(), - 0, tx_port - }; + ); } void recompress_process_async(void *state, shared_ptr frame) @@ -71,7 +74,7 @@ void recompress_process_async(void *state, shared_ptr frame) s->frames += 1; - chrono::steady_clock::time_point now = chrono::steady_clock::now(); + chrono::system_clock::time_point now = chrono::system_clock::now(); double seconds = chrono::duration_cast(now - s->t0).count() / 1000000.0; if(seconds > 5) { double fps = s->frames / seconds; diff --git a/src/utils/video_frame_pool.h b/src/utils/video_frame_pool.h index 4ef2069d6..dc77ed653 100644 --- a/src/utils/video_frame_pool.h +++ b/src/utils/video_frame_pool.h @@ -111,7 +111,7 @@ struct video_frame_pool { lock_guard guard(m_lock); if (this->m_generation != generation) { - deallocate_frame(frame); + this->deallocate_frame(frame); } else { m_free_frames.push(frame); }