summaryrefslogtreecommitdiff
path: root/src/screens
diff options
context:
space:
mode:
authorAndrzej Rybczak <andrzej@rybczak.net>2020-12-13 16:14:13 +0100
committerAndrzej Rybczak <andrzej@rybczak.net>2020-12-13 16:16:34 +0100
commit8575a9132cbb411a717204fb4f0cc3b954e44e31 (patch)
treef851bb8d0b15a5f201e176bffa350575df506639 /src/screens
parent9749e49cfcbed1e2525bfb72bc6e44e90db72034 (diff)
Disable hacky attempt to sync visualization with audio by default
Diffstat (limited to 'src/screens')
-rw-r--r--src/screens/visualizer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/screens/visualizer.cpp b/src/screens/visualizer.cpp
index 9955ee42..39da67eb 100644
--- a/src/screens/visualizer.cpp
+++ b/src/screens/visualizer.cpp
@@ -160,12 +160,15 @@ void Visualizer::update()
memcpy(sdata_end - data, temp_sdata, data);
}
- if (m_output_id != -1 && Global::Timer - m_timer > Config.visualizer_sync_interval)
+ if (Config.visualizer_sync_interval > boost::posix_time::seconds(0))
{
- Mpd.DisableOutput(m_output_id);
- usleep(50000);
- Mpd.EnableOutput(m_output_id);
- m_timer = Global::Timer;
+ 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;
+ }
}
void (Visualizer::*draw)(int16_t *, ssize_t, size_t, size_t);