Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: Source/modules/webaudio/AudioParam.cpp

Issue 354213002: Initialize value since calculateFinalValues may fail to do so. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/modules/webaudio/BiquadDSPKernel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // If we get close enough then snap to actual value. 89 // If we get close enough then snap to actual value.
90 if (fabs(m_smoothedValue - m_value) < SnapThreshold) // FIXME: the thres hold needs to be adjustable depending on range - but this is OK general purpose value. 90 if (fabs(m_smoothedValue - m_value) < SnapThreshold) // FIXME: the thres hold needs to be adjustable depending on range - but this is OK general purpose value.
91 m_smoothedValue = m_value; 91 m_smoothedValue = m_value;
92 } 92 }
93 93
94 return false; 94 return false;
95 } 95 }
96 96
97 float AudioParam::finalValue() 97 float AudioParam::finalValue()
98 { 98 {
99 float value; 99 float value = m_value;
100 calculateFinalValues(&value, 1, false); 100 calculateFinalValues(&value, 1, false);
101 return value; 101 return value;
102 } 102 }
103 103
104 void AudioParam::calculateSampleAccurateValues(float* values, unsigned numberOfV alues) 104 void AudioParam::calculateSampleAccurateValues(float* values, unsigned numberOfV alues)
105 { 105 {
106 bool isSafe = context() && context()->isAudioThread() && values && numberOfV alues; 106 bool isSafe = context() && context()->isAudioThread() && values && numberOfV alues;
107 ASSERT(isSafe); 107 ASSERT(isSafe);
108 if (!isSafe) 108 if (!isSafe)
109 return; 109 return;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 if (m_outputs.contains(output)) { 191 if (m_outputs.contains(output)) {
192 m_outputs.remove(output); 192 m_outputs.remove(output);
193 changedOutputs(); 193 changedOutputs();
194 output->removeParam(this); 194 output->removeParam(this);
195 } 195 }
196 } 196 }
197 197
198 } // namespace WebCore 198 } // namespace WebCore
199 199
200 #endif // ENABLE(WEB_AUDIO) 200 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « no previous file | Source/modules/webaudio/BiquadDSPKernel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698