Commit 7b088998 by andrewlewis Committed by Oliver Woodman

Move resetting audio processors to initialize()

The set of active audio processors was only updated on reconfiguration and when
draining playback parameters completed. Draining playback parameters are cleared
in reset(), so if parameters were set while paused then the sink was quickly
reset, without draining completing, the set of active audio processors wouldn't
be updated. This means that a switch to or from speed or pitch = 1 would not be
handled correctly if made while paused and followed by a seek.

Move resetting active audio processors from configure (where if the active audio
processors were reset we'd always initialize a new AudioTrack) to initialize().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177442098
parent cc54d4d3
......@@ -25,6 +25,8 @@
preferred language is not available
([#2980](https://github.com/google/ExoPlayer/issues/2980)).
* Add optional parameter to `Player.stop` to reset the player when stopping.
* Fix handling of playback parameters changes while paused when followed by a
seek.
### 2.6.0 ###
......
......@@ -364,9 +364,6 @@ public final class DefaultAudioSink implements AudioSink {
encoding = audioProcessor.getOutputEncoding();
}
}
if (flush) {
resetAudioProcessors();
}
}
int channelConfig;
......@@ -492,6 +489,9 @@ public final class DefaultAudioSink implements AudioSink {
// The old playback parameters may no longer be applicable so try to reset them now.
setPlaybackParameters(playbackParameters);
// Flush and reset active audio processors.
resetAudioProcessors();
int audioSessionId = audioTrack.getAudioSessionId();
if (enablePreV21AudioSessionWorkaround) {
if (Util.SDK_INT < 21) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment