mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Release ownedSurface before stopping the player on timeout
PiperOrigin-RevId: 386206960
This commit is contained in:
parent
fe5a7fcc13
commit
ab416f41ac
1 changed files with 9 additions and 6 deletions
|
|
@ -1988,6 +1988,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
.send());
|
.send());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
boolean messageDeliveryTimedOut = false;
|
||||||
if (this.videoOutput != null && this.videoOutput != videoOutput) {
|
if (this.videoOutput != null && this.videoOutput != videoOutput) {
|
||||||
// We're replacing an output. Block to ensure that this output will not be accessed by the
|
// We're replacing an output. Block to ensure that this output will not be accessed by the
|
||||||
// renderers after this method returns.
|
// renderers after this method returns.
|
||||||
|
|
@ -1998,12 +1999,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
} catch (TimeoutException e) {
|
} catch (TimeoutException e) {
|
||||||
// One of the renderers timed out releasing its resources.
|
messageDeliveryTimedOut = true;
|
||||||
player.stop(
|
|
||||||
/* reset= */ false,
|
|
||||||
ExoPlaybackException.createForUnexpected(
|
|
||||||
new ExoTimeoutException(ExoTimeoutException.TIMEOUT_OPERATION_DETACH_SURFACE),
|
|
||||||
PlaybackException.ERROR_CODE_TIMEOUT));
|
|
||||||
}
|
}
|
||||||
if (this.videoOutput == ownedSurface) {
|
if (this.videoOutput == ownedSurface) {
|
||||||
// We're replacing a surface that we are responsible for releasing.
|
// We're replacing a surface that we are responsible for releasing.
|
||||||
|
|
@ -2012,6 +2008,13 @@ public class SimpleExoPlayer extends BasePlayer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.videoOutput = videoOutput;
|
this.videoOutput = videoOutput;
|
||||||
|
if (messageDeliveryTimedOut) {
|
||||||
|
player.stop(
|
||||||
|
/* reset= */ false,
|
||||||
|
ExoPlaybackException.createForUnexpected(
|
||||||
|
new ExoTimeoutException(ExoTimeoutException.TIMEOUT_OPERATION_DETACH_SURFACE),
|
||||||
|
PlaybackException.ERROR_CODE_TIMEOUT));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue