13
0

remove b0rked attempt at meter-thread regularity.

eventually fall-off should be calculated in the audio-thread, anyway
and this thread will be obsolete..
This commit is contained in:
Robin Gareus 2013-07-08 17:58:38 +02:00
parent 40bc6f5b83
commit 6aecd192ce

View File

@ -759,7 +759,6 @@ void
AudioEngine::meter_thread ()
{
pthread_set_name (X_("meter"));
#if 1
while (true) {
Glib::usleep (10000);
if (g_atomic_int_get(&m_meter_exit)) {
@ -767,28 +766,6 @@ AudioEngine::meter_thread ()
}
Metering::Meter ();
}
#else
struct timeval clock1, clock2;
int64_t delay = 10000; /* 1/100th sec interval */
while (true) {
/* TODO use select() for sleep:
* select() has a maxium delay time,
* [u]sleep has a minimum delay time
*/
Glib::usleep (delay);
if (g_atomic_int_get(&m_meter_exit)) {
break;
}
gettimeofday(&clock1, NULL);
Metering::Meter ();
gettimeofday(&clock2, NULL);
const int64_t elapsed_time =
(clock2.tv_sec-clock1.tv_sec) * 10000
+ (clock2.tv_usec-clock1.tv_usec);
delay = max((int64_t)0, 10000 - elapsed_time);
}
#endif
}
void