Title: [102810] trunk/Source/WebCore
- Revision
- 102810
- Author
- commit-qu...@webkit.org
- Date
- 2011-12-14 12:33:07 -0800 (Wed, 14 Dec 2011)
Log Message
Patch by Raymond Toy <r...@google.com> on 2011-12-14
* platform/audio/Distance.h (WebCore):
Incorrect calculation for DistanceEffect linearGain
https://bugs.webkit.org/show_bug.cgi?id=72871
Reviewed by Kenneth Russell.
Tests still need to be written for all distance models. This
does not add a new API and just corrects an implementation error.
* platform/audio/Distance.cpp:
(WebCore::DistanceEffect::linearGain): Implement correct
linearGain function. (Fix proposed by davidgale...@hotmail.com.)
* platform/audio/Distance.h: Add link to Open AL specification.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (102809 => 102810)
--- trunk/Source/WebCore/ChangeLog 2011-12-14 20:00:22 UTC (rev 102809)
+++ trunk/Source/WebCore/ChangeLog 2011-12-14 20:33:07 UTC (rev 102810)
@@ -1,3 +1,21 @@
+2011-12-14 Raymond Toy <r...@google.com>
+
+ * platform/audio/Distance.h (WebCore):
+
+ Incorrect calculation for DistanceEffect linearGain
+ https://bugs.webkit.org/show_bug.cgi?id=72871
+
+ Reviewed by Kenneth Russell.
+
+ Tests still need to be written for all distance models. This
+ does not add a new API and just corrects an implementation error.
+
+ * platform/audio/Distance.cpp:
+ (WebCore::DistanceEffect::linearGain): Implement correct
+ linearGain function. (Fix proposed by davidgale...@hotmail.com.)
+ * platform/audio/Distance.h: Add link to Open AL specification.
+
+
2011-12-14 Ilya Tikhonovsky <loi...@chromium.org>
Web Inspector: consider disabling network tracking while running the CPU profile.
Modified: trunk/Source/WebCore/platform/audio/Distance.cpp (102809 => 102810)
--- trunk/Source/WebCore/platform/audio/Distance.cpp 2011-12-14 20:00:22 UTC (rev 102809)
+++ trunk/Source/WebCore/platform/audio/Distance.cpp 2011-12-14 20:33:07 UTC (rev 102810)
@@ -71,7 +71,9 @@
double DistanceEffect::linearGain(double distance)
{
- return (1.0 - m_rolloffFactor * (distance - m_refDistance)) / (m_maxDistance - m_refDistance);
+ // We want a gain that decreases linearly from m_refDistance to
+ // m_maxDistance. The gain is 1 at m_refDistance.
+ return (1.0 - m_rolloffFactor * (distance - m_refDistance) / (m_maxDistance - m_refDistance));
}
double DistanceEffect::inverseGain(double distance)
Modified: trunk/Source/WebCore/platform/audio/Distance.h (102809 => 102810)
--- trunk/Source/WebCore/platform/audio/Distance.h 2011-12-14 20:00:22 UTC (rev 102809)
+++ trunk/Source/WebCore/platform/audio/Distance.h 2011-12-14 20:33:07 UTC (rev 102810)
@@ -31,7 +31,8 @@
namespace WebCore {
-// Distance models are defined according to the OpenAL specification
+// Distance models are defined according to the OpenAL specification:
+// http://connect.creativelabs.com/openal/Documentation/OpenAL%201.1%20Specification.htm.
class DistanceEffect {
public:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes