Change AudioGraph #release to #reset, resetting internal state.
PiperOrigin-RevId: 589113634
This commit is contained in:
parent
c5c8e988e8
commit
1471528176
@ -124,13 +124,17 @@ import java.util.Objects;
|
||||
return currentOutput;
|
||||
}
|
||||
|
||||
/** Releases underlying resources, including clearing the inputs. */
|
||||
public void release() {
|
||||
/** Resets the graph to an unconfigured state, releasing any underlying resources. */
|
||||
public void reset() {
|
||||
for (int i = 0; i < inputs.size(); i++) {
|
||||
inputs.valueAt(i).release();
|
||||
}
|
||||
inputs.clear();
|
||||
mixer.reset();
|
||||
|
||||
finishedInputs = 0;
|
||||
currentOutput = EMPTY_BUFFER;
|
||||
outputAudioFormat = AudioFormat.NOT_SET;
|
||||
}
|
||||
|
||||
/** Returns whether the input has ended and all queued data has been output. */
|
||||
|
@ -151,7 +151,9 @@ import java.util.concurrent.atomic.AtomicReference;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Releases any underlying resources. */
|
||||
public void release() {
|
||||
// TODO(b/303029174): Impl flush(), reset() & decide if a separate release() is still needed.
|
||||
audioProcessingPipeline.reset();
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ import org.checkerframework.dataflow.qual.Pure;
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
audioGraph.release();
|
||||
audioGraph.reset();
|
||||
encoder.release();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user