diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f4f8543d6d..bc44257f74 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -78,6 +78,13 @@ ([#3750](https://github.com/google/ExoPlayer/issues/3750)). * Add a way to override ad media MIME types ([#7961)(https://github.com/google/ExoPlayer/issues/7961)). + * Fix truncating large cue points in microseconds + ([#8067](https://github.com/google/ExoPlayer/issues/8067)). + +* UI: + + * Show overflow button in `StyledPlayerControlView` only when there is no + enough space. ### 2.12.0 (2020-09-11) ### diff --git a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java index 08662ea330..296268ebb9 100644 --- a/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java +++ b/extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java @@ -1596,7 +1596,8 @@ public final class ImaAdsLoader // We receive initial cue points from IMA SDK as floats. This code replicates the same // calculation used to populate adGroupTimesUs (having truncated input back to float, to avoid // failures if the behavior of the IMA SDK changes to provide greater precision). - long adPodTimeUs = Math.round((float) cuePointTimeSeconds * C.MICROS_PER_SECOND); + float cuePointTimeSecondsFloat = (float) cuePointTimeSeconds; + long adPodTimeUs = Math.round((double) cuePointTimeSecondsFloat * C.MICROS_PER_SECOND); for (int adGroupIndex = 0; adGroupIndex < adPlaybackState.adGroupCount; adGroupIndex++) { long adGroupTimeUs = adPlaybackState.adGroupTimesUs[adGroupIndex]; if (adGroupTimeUs != C.TIME_END_OF_SOURCE diff --git a/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java b/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java index d894466091..d64f6c4b67 100644 --- a/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java +++ b/extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java @@ -803,7 +803,8 @@ public final class ImaAdsLoaderTest { @Test public void loadAd_withLargeAdCuePoint_updatesAdPlaybackStateWithLoadedAd() { - float midrollTimeSecs = 1_765f; + // Use a large enough value to test correct truncating of large cue points. + float midrollTimeSecs = Float.MAX_VALUE; ImmutableList cuePoints = ImmutableList.of(midrollTimeSecs); setupPlayback(CONTENT_TIMELINE, cuePoints); imaAdsLoader.start(adsLoaderListener, adViewProvider);