Commit ffa746f3 by andrewlewis Committed by Ian Baker

Fix checking imaAdMediaInfo nullness

It's intended to log a warning in this case, rather than throw.

Issue: #8290

PiperOrigin-RevId: 347790527
parent 125de929
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
* IMA extension: * IMA extension:
* Fix a condition where playback can get stuck before an empty ad * Fix a condition where playback can get stuck before an empty ad
([#8205](https://github.com/google/ExoPlayer/issues/8205)). ([#8205](https://github.com/google/ExoPlayer/issues/8205)).
* Log a warning rather than throwing when reaching the end of the stream
with an ad playing but without ad media info
([#8290](https://github.com/google/ExoPlayer/issues/8290)).
* Text: * Text:
* Gracefully handle null-terminated subtitle content in Matroska * Gracefully handle null-terminated subtitle content in Matroska
containers. containers.
...@@ -78,6 +81,7 @@ ...@@ -78,6 +81,7 @@
* Notify onBufferingEnded when the state of origin player becomes * Notify onBufferingEnded when the state of origin player becomes
`STATE_IDLE` or `STATE_ENDED`. `STATE_IDLE` or `STATE_ENDED`.
* Allow to remove all playlist items that makes the player reset. * Allow to remove all playlist items that makes the player reset.
([#8047](https://github.com/google/ExoPlayer/issues/8047)).
### 2.12.1 (2020-10-23) ### ### 2.12.1 (2020-10-23) ###
......
...@@ -1260,7 +1260,7 @@ public final class ImaAdsLoader ...@@ -1260,7 +1260,7 @@ public final class ImaAdsLoader
&& playWhenReady) { && playWhenReady) {
ensureSentContentCompleteIfAtEndOfStream(); ensureSentContentCompleteIfAtEndOfStream();
} else if (imaAdState != IMA_AD_STATE_NONE && playbackState == Player.STATE_ENDED) { } else if (imaAdState != IMA_AD_STATE_NONE && playbackState == Player.STATE_ENDED) {
AdMediaInfo adMediaInfo = checkNotNull(imaAdMediaInfo); @Nullable AdMediaInfo adMediaInfo = imaAdMediaInfo;
if (adMediaInfo == null) { if (adMediaInfo == null) {
Log.w(TAG, "onEnded without ad media info"); Log.w(TAG, "onEnded without ad media info");
} else { } else {
......
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