Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
75513e58
authored
Oct 14, 2020
by
bachinger
Committed by
Oliver Woodman
Oct 17, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Use Math.round(double) to avoid result being limited to Integer.MAX_INT
Issue: #8067 PiperOrigin-RevId: 337122011
parent
2371b024
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
RELEASENOTES.md
extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java
extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java
RELEASENOTES.md
View file @
75513e58
...
...
@@ -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) ###
...
...
extensions/ima/src/main/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoader.java
View file @
75513e58
...
...
@@ -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
...
...
extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java
View file @
75513e58
...
...
@@ -803,7 +803,8 @@ public final class ImaAdsLoaderTest {
@Test
public
void
loadAd_withLargeAdCuePoint_updatesAdPlaybackStateWithLoadedAd
()
{
float
midrollTimeSecs
=
1_765
f
;
// Use a large enough value to test correct truncating of large cue points.
float
midrollTimeSecs
=
Float
.
MAX_VALUE
;
ImmutableList
<
Float
>
cuePoints
=
ImmutableList
.
of
(
midrollTimeSecs
);
setupPlayback
(
CONTENT_TIMELINE
,
cuePoints
);
imaAdsLoader
.
start
(
adsLoaderListener
,
adViewProvider
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment