Skip to content

Commit

Permalink
Merge pull request #6515 from Redirion/buffersharmonization
Browse files Browse the repository at this point in the history
Use ExoPlayer default values for buffers
  • Loading branch information
Redirion authored Aug 29, 2021
2 parents 43e91ae + f5d015e commit 8bfd380
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ public class LoadController implements LoadControl {
//////////////////////////////////////////////////////////////////////////*/

public LoadController() {
this(PlayerHelper.getPlaybackStartBufferMs(),
PlayerHelper.getPlaybackMinimumBufferMs(),
PlayerHelper.getPlaybackOptimalBufferMs());
this(PlayerHelper.getPlaybackStartBufferMs());
}

private LoadController(final int initialPlaybackBufferMs,
final int minimumPlaybackBufferMs,
final int optimalPlaybackBufferMs) {
private LoadController(final int initialPlaybackBufferMs) {
this.initialPlaybackBufferUs = initialPlaybackBufferMs * 1000;

final DefaultLoadControl.Builder builder = new DefaultLoadControl.Builder();
builder.setBufferDurationsMs(minimumPlaybackBufferMs, optimalPlaybackBufferMs,
builder.setBufferDurationsMs(
DefaultLoadControl.DEFAULT_MIN_BUFFER_MS,
DefaultLoadControl.DEFAULT_MAX_BUFFER_MS,
initialPlaybackBufferMs,
DefaultLoadControl.DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS);
internalLoadControl = builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,22 +307,6 @@ public static int getPlaybackStartBufferMs() {
return 500;
}

/**
* @return the minimum number of milliseconds the player always buffers to
* after starting playback.
*/
public static int getPlaybackMinimumBufferMs() {
return 25000;
}

/**
* @return the maximum/optimal number of milliseconds the player will buffer to once the buffer
* hits the point of {@link #getPlaybackMinimumBufferMs()}.
*/
public static int getPlaybackOptimalBufferMs() {
return 60000;
}

public static TrackSelection.Factory getQualitySelector() {
return new AdaptiveTrackSelection.Factory(
1000,
Expand Down

0 comments on commit 8bfd380

Please sign in to comment.