From: <man...@us...> - 2014-09-17 11:21:24
|
Revision: 4297 http://sourceforge.net/p/modplug/code/4297 Author: manxorist Date: 2014-09-17 11:21:16 +0000 (Wed, 17 Sep 2014) Log Message: ----------- [Fix] sounddev: There are cases where a Latency or UpdateInterval value of 0 ended up in the ini file. A value of 0 generally does not make any sense and clamping it to the allowed range always results in the shortest possible interval which is in most cases not the optimal result. Instead, if a value of 0 is found, use the default value now. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/sounddev/SoundDevice.cpp Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-09-17 08:49:10 UTC (rev 4296) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-09-17 11:21:16 UTC (rev 4297) @@ -714,6 +714,7 @@ m_CbnLatencyMS.GetWindowText(s); m_Settings.Latency = ParseTime(s); //Check given value. + if(m_Settings.Latency == 0.0) m_Settings.Latency = m_CurrentDeviceCaps.DefaultSettings.Latency; m_Settings.Latency = Clamp(m_Settings.Latency, m_CurrentDeviceCaps.LatencyMin, m_CurrentDeviceCaps.LatencyMax); m_CbnLatencyMS.SetWindowText(PrintTime(m_Settings.Latency)); } @@ -723,6 +724,7 @@ m_CbnUpdateIntervalMS.GetWindowText(s); m_Settings.UpdateInterval = ParseTime(s); //Check given value. + if(m_Settings.UpdateInterval == 0.0) m_Settings.UpdateInterval = m_CurrentDeviceCaps.DefaultSettings.UpdateInterval; m_Settings.UpdateInterval = Clamp(m_Settings.UpdateInterval, m_CurrentDeviceCaps.UpdateIntervalMin, m_CurrentDeviceCaps.UpdateIntervalMax); m_CbnUpdateIntervalMS.SetWindowText(PrintTime(m_Settings.UpdateInterval)); } Modified: trunk/OpenMPT/sounddev/SoundDevice.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.cpp 2014-09-17 08:49:10 UTC (rev 4296) +++ trunk/OpenMPT/sounddev/SoundDevice.cpp 2014-09-17 11:21:16 UTC (rev 4297) @@ -231,6 +231,8 @@ Close(); } m_Settings = settings; + if(m_Settings.Latency == 0.0) m_Settings.Latency = m_Caps.DefaultSettings.Latency; + if(m_Settings.UpdateInterval == 0.0) m_Settings.UpdateInterval = m_Caps.DefaultSettings.UpdateInterval; m_Settings.Latency = Clamp(m_Settings.Latency, m_Caps.LatencyMin, m_Caps.LatencyMax); m_Settings.UpdateInterval = Clamp(m_Settings.UpdateInterval, m_Caps.UpdateIntervalMin, m_Caps.UpdateIntervalMax); if(!m_Settings.ChannelMapping.IsValid(m_Settings.Channels)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |