mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +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);
|
||||
break;
|
||||
case MSG_ATTEMPT_RENDERER_ERROR_RECOVERY:
|
||||
attemptRendererErrorRecovery((ExoPlaybackException) msg.obj);
|
||||
attemptRendererErrorRecovery();
|
||||
break;
|
||||
case MSG_RELEASE:
|
||||
releaseInternal();
|
||||
|
|
@ -563,7 +563,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
handler.obtainMessage(MSG_ATTEMPT_RENDERER_ERROR_RECOVERY, e));
|
||||
} else {
|
||||
if (pendingRecoverableRendererError != null) {
|
||||
e.addSuppressed(pendingRecoverableRendererError);
|
||||
pendingRecoverableRendererError.addSuppressed(e);
|
||||
e = pendingRecoverableRendererError;
|
||||
}
|
||||
Log.e(TAG, "Playback error", e);
|
||||
stopInternal(/* forceResetRenderers= */ true, /* acknowledgeStop= */ false);
|
||||
|
|
@ -593,17 +594,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
|
||||
// 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
|
||||
* elapsed.
|
||||
|
|
@ -838,6 +828,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
}
|
||||
}
|
||||
|
||||
private void attemptRendererErrorRecovery() throws ExoPlaybackException {
|
||||
seekToCurrentPosition(/* sendDiscontinuity= */ true);
|
||||
}
|
||||
|
||||
private void updatePlaybackPositions() throws ExoPlaybackException {
|
||||
MediaPeriodHolder playingPeriodHolder = queue.getPlayingPeriod();
|
||||
if (playingPeriodHolder == null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue