Toggle the fifo output once if synchronization is disabled
This commit is contained in:
@@ -112,7 +112,8 @@ void Visualizer::switchTo()
|
||||
SwitchTo::execute(this);
|
||||
w.clear();
|
||||
SetFD();
|
||||
m_timer = boost::posix_time::from_time_t(0);
|
||||
// negative infinity to toggle output in update() at least once
|
||||
m_timer = boost::posix_time::neg_infin;
|
||||
drawHeader();
|
||||
memset(m_sample_buffer.data(), 0, m_sample_buffer.size()*sizeof(int16_t));
|
||||
# ifdef HAVE_FFTW3_H
|
||||
@@ -160,15 +161,12 @@ void Visualizer::update()
|
||||
memcpy(sdata_end - data, temp_sdata, data);
|
||||
}
|
||||
|
||||
if (Config.visualizer_sync_interval > boost::posix_time::seconds(0))
|
||||
if (m_output_id != -1 && Global::Timer - m_timer > Config.visualizer_sync_interval)
|
||||
{
|
||||
if (m_output_id != -1 && Global::Timer - m_timer > Config.visualizer_sync_interval)
|
||||
{
|
||||
Mpd.DisableOutput(m_output_id);
|
||||
usleep(50000);
|
||||
Mpd.EnableOutput(m_output_id);
|
||||
m_timer = Global::Timer;
|
||||
}
|
||||
Mpd.DisableOutput(m_output_id);
|
||||
usleep(50000);
|
||||
Mpd.EnableOutput(m_output_id);
|
||||
m_timer = Global::Timer;
|
||||
}
|
||||
|
||||
void (Visualizer::*draw)(int16_t *, ssize_t, size_t, size_t);
|
||||
|
||||
Reference in New Issue
Block a user