mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Consistently throw the original exception if recovery fails
PiperOrigin-RevId: 355664280
This commit is contained in:
parent
a245fbdc99
commit
438bcada38
1 changed files with 7 additions and 13 deletions
|
|
@ -535,7 +535,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
setOffloadSchedulingEnabledInternal(msg.arg1 == 1);
|
setOffloadSchedulingEnabledInternal(msg.arg1 == 1);
|
||||||
break;
|
break;
|
||||||
case MSG_ATTEMPT_RENDERER_ERROR_RECOVERY:
|
case MSG_ATTEMPT_RENDERER_ERROR_RECOVERY:
|
||||||
attemptRendererErrorRecovery((ExoPlaybackException) msg.obj);
|
attemptRendererErrorRecovery();
|
||||||
break;
|
break;
|
||||||
case MSG_RELEASE:
|
case MSG_RELEASE:
|
||||||
releaseInternal();
|
releaseInternal();
|
||||||
|
|
@ -563,7 +563,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
handler.obtainMessage(MSG_ATTEMPT_RENDERER_ERROR_RECOVERY, e));
|
handler.obtainMessage(MSG_ATTEMPT_RENDERER_ERROR_RECOVERY, e));
|
||||||
} else {
|
} else {
|
||||||
if (pendingRecoverableRendererError != null) {
|
if (pendingRecoverableRendererError != null) {
|
||||||
e.addSuppressed(pendingRecoverableRendererError);
|
pendingRecoverableRendererError.addSuppressed(e);
|
||||||
|
e = pendingRecoverableRendererError;
|
||||||
}
|
}
|
||||||
Log.e(TAG, "Playback error", e);
|
Log.e(TAG, "Playback error", e);
|
||||||
stopInternal(/* forceResetRenderers= */ true, /* acknowledgeStop= */ false);
|
stopInternal(/* forceResetRenderers= */ true, /* acknowledgeStop= */ false);
|
||||||
|
|
@ -593,17 +594,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
// Private methods.
|
// Private methods.
|
||||||
|
|
||||||
private void attemptRendererErrorRecovery(ExoPlaybackException exceptionToRecoverFrom)
|
|
||||||
throws ExoPlaybackException {
|
|
||||||
Assertions.checkArgument(exceptionToRecoverFrom.isRecoverable);
|
|
||||||
try {
|
|
||||||
seekToCurrentPosition(/* sendDiscontinuity= */ true);
|
|
||||||
} catch (Exception e) {
|
|
||||||
exceptionToRecoverFrom.addSuppressed(e);
|
|
||||||
throw exceptionToRecoverFrom;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Blocks the current thread until a condition becomes true or the specified amount of time has
|
* Blocks the current thread until a condition becomes true or the specified amount of time has
|
||||||
* elapsed.
|
* elapsed.
|
||||||
|
|
@ -838,6 +828,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void attemptRendererErrorRecovery() throws ExoPlaybackException {
|
||||||
|
seekToCurrentPosition(/* sendDiscontinuity= */ true);
|
||||||
|
}
|
||||||
|
|
||||||
private void updatePlaybackPositions() throws ExoPlaybackException {
|
private void updatePlaybackPositions() throws ExoPlaybackException {
|
||||||
MediaPeriodHolder playingPeriodHolder = queue.getPlayingPeriod();
|
MediaPeriodHolder playingPeriodHolder = queue.getPlayingPeriod();
|
||||||
if (playingPeriodHolder == null) {
|
if (playingPeriodHolder == null) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue