Commit ddf05a94 by krocard Committed by Oliver Woodman

Rollback of https://github.com/google/ExoPlayer/commit/2674e05589730cdc3b55bfb15448253f7868492a

*** Original commit ***

Make audio track min buffer size configurable.

Move the code in its own class as DefaultAudioTrack
is getting very big. It also help for testability.

The new class is easily configurable and highly tested.
Manual test was used to catch any regression.

https://github.com/google/ExoPlayer/issues/8891

***

PiperOrigin-RevId: 415469179
parent f3d76e9e
......@@ -30,9 +30,6 @@
constructors.
* Change `AudioCapabilities` APIs to require passing explicitly
`AudioCapabilities.DEFAULT_AUDIO_CAPABILITIES` instead of `null`.
* Allow customization of the `AudioTrack` buffer size calculation by
injecting an `AudioTrackBufferSizeProvider` to `DefaultAudioSink`.
([#8891](https://github.com/google/ExoPlayer/issues/8891)).
* Extractors:
* Fix inconsistency with spec in H.265 SPS nal units parsing
((#9719)[https://github.com/google/ExoPlayer/issues/9719]).
......
......@@ -808,23 +808,6 @@ public final class Util {
}
/**
* Returns the value of the {@code long} argument; throwing an exception if the value overflows an
* {@code int}.
*
* <p>Equivalent to API 26 {@link Math#toIntExact}.
*
* @param value The long value.
* @return The argument as an int.
* @throws ArithmeticException If the {@code argument} overflows an int.
*/
public static int toIntExact(long value) {
if ((int) value != value) {
throw new ArithmeticException(); // integer overflow
}
return (int) value;
}
/**
* Returns the index of the first occurrence of {@code value} in {@code array}, or {@link
* C#INDEX_UNSET} if {@code value} is not contained in {@code array}.
*
......
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