Commit dfc3c507 by Oliver Woodman Committed by Andrew Lewis

Don't allow bad MediaSource release implementation to crash player.

This also allows subsequent MediaSource instance in the list to still
be released successfully.

Issue: #7168
parent 1772b0d9
...@@ -954,7 +954,12 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -954,7 +954,12 @@ import java.util.concurrent.atomic.AtomicBoolean;
startPositionUs); startPositionUs);
if (releaseMediaSource) { if (releaseMediaSource) {
if (mediaSource != null) { if (mediaSource != null) {
mediaSource.releaseSource(/* caller= */ this); try {
mediaSource.releaseSource(/* caller= */ this);
} catch (RuntimeException e) {
// There's nothing we can do.
Log.e(TAG, "Failed to release child source.", e);
}
mediaSource = null; mediaSource = null;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment