Commit f7fff0d5 by andrewlewis Committed by Oliver Woodman

Apply parameter adjustments with resetting.

Start draining the audio processors when the playback parameters change,
and when draining completes use the written frame count and next input
buffer presentation timestamp as an offset for applying the new playback
speed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151800074
parent a473e730
...@@ -102,11 +102,17 @@ import java.nio.ShortBuffer; ...@@ -102,11 +102,17 @@ import java.nio.ShortBuffer;
} }
/** /**
* Returns the number of input frames corresponding to the specified number of output frames. * Returns the number of bytes of input queued since the last call to {@link #flush()}.
*/ */
public long getInputFrames(long outputFrames) { public long getInputByteCount() {
// Sonic produces output data as soon as input is queued. return inputBytes;
return outputBytes == 0 ? 0 : Util.scaleLargeTimestamp(outputFrames, inputBytes, outputBytes); }
/**
* Returns the number of bytes of output dequeued since the last call to {@link #flush()}.
*/
public long getOutputByteCount() {
return outputBytes;
} }
@Override @Override
......
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