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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioBasicInspectorNode.cpp

Issue 2666063003: Continue to process AnalyserNode if inputs are silent. (Closed)
Patch Set: Add test Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012, Intel Corporation. All rights reserved. 2 * Copyright (C) 2012, Intel Corporation. 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 m_needAutomaticPull = false; 108 m_needAutomaticPull = false;
109 } 109 }
110 } else { 110 } else {
111 unsigned numberOfInputConnections = input(0).numberOfRenderingConnections(); 111 unsigned numberOfInputConnections = input(0).numberOfRenderingConnections();
112 if (numberOfInputConnections && !m_needAutomaticPull) { 112 if (numberOfInputConnections && !m_needAutomaticPull) {
113 // When an AudioBasicInspectorNode is not connected to any downstream node 113 // When an AudioBasicInspectorNode is not connected to any downstream node
114 // while still connected from upstream node(s), add it to the context's 114 // while still connected from upstream node(s), add it to the context's
115 // automatic pull list. 115 // automatic pull list.
116 context()->deferredTaskHandler().addAutomaticPullNode(this); 116 context()->deferredTaskHandler().addAutomaticPullNode(this);
117 m_needAutomaticPull = true; 117 m_needAutomaticPull = true;
118 } else if (!numberOfInputConnections && m_needAutomaticPull) { 118 } else if (!numberOfInputConnections && m_needAutomaticPull &&
119 // The AudioBasicInspectorNode is connected to nothing, remove it from the 119 getNodeType() != NodeTypeAnalyser) {
120 // context's automatic pull list. 120 // The AudioBasicInspectorNode is connected to nothing and is
121 // not an AnalyserNode, remove it from the context's automatic
122 // pull list. AnalyserNode's need to be pulled even with no
123 // inputs so that the internal state gets updated to hold the
124 // right time and FFT data.
hongchan 2017/02/01 01:12:11 We should at least consider refactoring this metho
Raymond Toy 2017/02/01 21:21:01 Done. But a bit of duplication.
121 context()->deferredTaskHandler().removeAutomaticPullNode(this); 125 context()->deferredTaskHandler().removeAutomaticPullNode(this);
122 m_needAutomaticPull = false; 126 m_needAutomaticPull = false;
123 } 127 }
124 } 128 }
125 } 129 }
126 130
127 } // namespace blink 131 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698