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
3fbfc0ec
authored
Mar 23, 2021
by
gyumin
Committed by
Ian Baker
Mar 24, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix Timeline.toBundle for empty timeline
PiperOrigin-RevId: 364513299
parent
bb1261da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
library/common/src/main/java/com/google/android/exoplayer2/Timeline.java
library/common/src/test/java/com/google/android/exoplayer2/TimelineTest.java
library/common/src/main/java/com/google/android/exoplayer2/Timeline.java
View file @
3fbfc0ec
...
@@ -1291,7 +1291,9 @@ public abstract class Timeline implements Bundleable {
...
@@ -1291,7 +1291,9 @@ public abstract class Timeline implements Bundleable {
}
}
int
[]
shuffledWindowIndices
=
new
int
[
windowCount
];
int
[]
shuffledWindowIndices
=
new
int
[
windowCount
];
shuffledWindowIndices
[
0
]
=
getFirstWindowIndex
(
/* shuffleModeEnabled= */
true
);
if
(
windowCount
>
0
)
{
shuffledWindowIndices
[
0
]
=
getFirstWindowIndex
(
/* shuffleModeEnabled= */
true
);
}
for
(
int
i
=
1
;
i
<
windowCount
;
i
++)
{
for
(
int
i
=
1
;
i
<
windowCount
;
i
++)
{
shuffledWindowIndices
[
i
]
=
shuffledWindowIndices
[
i
]
=
getNextWindowIndex
(
getNextWindowIndex
(
...
...
library/common/src/test/java/com/google/android/exoplayer2/TimelineTest.java
View file @
3fbfc0ec
...
@@ -279,6 +279,11 @@ public class TimelineTest {
...
@@ -279,6 +279,11 @@ public class TimelineTest {
}
}
@Test
@Test
public
void
roundtripViaBundle_ofEmptyTimeline_returnsEmptyTimeline
()
{
TimelineAsserts
.
assertEmpty
(
Timeline
.
CREATOR
.
fromBundle
(
Timeline
.
EMPTY
.
toBundle
()));
}
@Test
public
void
roundtripViaBundle_ofWindow_yieldsEqualInstanceExceptUidAndManifest
()
{
public
void
roundtripViaBundle_ofWindow_yieldsEqualInstanceExceptUidAndManifest
()
{
Timeline
.
Window
window
=
new
Timeline
.
Window
();
Timeline
.
Window
window
=
new
Timeline
.
Window
();
window
.
uid
=
new
Object
();
window
.
uid
=
new
Object
();
...
...
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