From 22f9e86fd1f16ffd72425302271d00ce822f5c9c Mon Sep 17 00:00:00 2001 From: Chris Moeller Date: Wed, 16 Oct 2013 03:21:12 -0700 Subject: [PATCH] Fixed std::chrono::duration shenanigans --- Plugins/MIDI/MIDI/BMPlayer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/MIDI/MIDI/BMPlayer.cpp b/Plugins/MIDI/MIDI/BMPlayer.cpp index 77b0c0d6d..720402e69 100644 --- a/Plugins/MIDI/MIDI/BMPlayer.cpp +++ b/Plugins/MIDI/MIDI/BMPlayer.cpp @@ -33,7 +33,7 @@ static bool is_gs_reset(const unsigned char * data, unsigned long size) struct Cached_SoundFont { unsigned long ref_count; - std::chrono::time_point time_released; + std::chrono::steady_clock::time_point time_released; HSOUNDFONT handle; Cached_SoundFont() : handle( 0 ) { } }; @@ -115,7 +115,7 @@ static void cache_run() while ( Cache_Running ) { - std::chrono::time_point now = std::chrono::steady_clock::now(); + std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); { std::lock_guard lock( Cache_Lock ); @@ -123,8 +123,8 @@ static void cache_run() { if ( it->second.ref_count == 0 ) { - std::chrono::duration elapsed = now - it->second.time_released; - if ( elapsed.count() >= 10.0 ) + auto elapsed = std::chrono::duration_cast ( now - it->second.time_released ); + if ( elapsed.count() >= 10 ) { BASS_MIDI_FontFree( it->second.handle ); it = Cache_List.erase( it );