Playback can get stuck buffering in tunneling mode
- Dominant language
- Java
- Stars
- 21.9k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
[REQUIRED] Issue description
I have to change the following default values inside `DefaultLoadControl` for some reasons.
```bash
diff --git a/library/core/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java b/library/core/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java
index 1244b96d9..7fcf3446d 100644
--- a/library/core/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java
+++ b/library/core/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java
@@ -31,26 +31,26 @@ public class DefaultLoadControl implements LoadControl {
* The default minimum duration of media that the player will attempt to ensure is buffered at all
* times, in milliseconds. This value is only applied to playbacks without video.
*/
- public static final int DEFAULT_MIN_BUFFER_MS = 15000;
+ public static final int DEFAULT_MIN_BUFFER_MS = 10000;
/**
* The default maximum duration of media that the player will attempt to buffer, in milliseconds.
* For playbacks with video, this is also the default minimum duration of media that the player
* will attempt to ensure is buffered.
*/
- public static final int DEFAULT_MAX_BUFFER_MS = 50000;
+ public static final int DEFAULT_MAX_BUFFER_MS = 30000;
/**
* The default duration of media that must be buffered for playback to start or resume following a
* user action such as a seek, in milliseconds.
*/
- public static final int DEFAULT_BUFFER_FOR_PLAYBACK_MS = 2500;
+ public static final int DEFAULT_BUFFER_FOR_PLAYBACK_MS = 30;
/**
* The default duration of media that must be buffered for playback to resume after a rebuffer, in
* milliseconds. A rebuffer is defined to be caused by buffer depletion rather than a user action.
*/
- public static final int DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS = 5000;
+ public static final int DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS = 4000;
/**
* The default target buffer size in bytes. The value ({@link C#LENGTH_UNSET}) means that the load
@@ -104,7 +104,7 @@ public class DefaultLoadControl implements LoadControl {
/** Constructs a new instance. */
public Builder() {
minBufferAudioMs = DEFAULT_MIN_BUFFER_MS;
- minBufferVideoMs = DEFAULT_MAX_BUFFER_MS;
+ minBufferVideoMs = DEFAULT_MIN_BUFFER_MS;
maxBufferMs = DEFAULT_MAX_BUFFER_MS;
bufferForPlaybackMs = DEFAULT_BUFFER_FOR_PLAYBACK_MS;
bufferForPlaybackAfterRebufferMs = DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS;
@@ -262,7 +262,7 @@ public class DefaultLoadControl implements LoadControl {
this(
allocator,
/* minBufferAudioMs= */ DEFAULT_MIN_BUFFER_MS,
- /* minBufferVideoMs= */ DEFAULT_MAX_BUFFER_MS,
+ /* minBufferVideoMs= */ DEFAULT_MIN_BUFFER_MS,
DEFAULT_MAX_BUFFER_MS,
DEFAULT_BUFFER_FOR_PLAYBACK_MS,
DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS,
```
--------
When I play a video in tunneling mode, the playback stays stalled on `STATE_BUFFERING`, but the playback without tunneling mode works well.
I guess a difference is that `hasOutputBuffer()` always returns false in tunneling mode.
Is there a way I can avoid the problem?
Thanks in advance for any help!
[REQUIRED] Reproduction steps
1. ExoPlayer demo app version release-v2(2.11.8), enable "Request multimedia tunneling"
2. Play video under SmoothStreaming -> Super Speed
3. While the video is playing in 3 seconds go to pause the video.
4. Wait 5 minutes.
5. Play the video again.
6. While the video is playing a while, observe that the video is frozen.

[REQUIRED] Link to test content
"name": "Super speed",
"uri": "https://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest"
[REQUIRED] A full bug report captured from the device
Not a crash so I assume one can reproduce it very easy and get the logs if necessary
[REQUIRED] Version of ExoPlayer being used
e82219633 (release-v2, tag: r2.11.8)
[REQUIRED] Device(s) and version(s) of Android being used
Reproducibility: 80% (Android TV)
Contributor guide
Assessment
This issue has not been assessed yet.