Skip to content

Commit

Permalink
Fix mediaMetadata being reset when media is repeated.
Browse files Browse the repository at this point in the history
Issue: #9458
PiperOrigin-RevId: 399901865
  • Loading branch information
Samrobbo authored and marcbaechinger committed Sep 30, 2021
1 parent 410ddf4 commit e335022
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
`GlUtil.glAssertionsEnabled` instead.
* Move `Player.addListener(EventListener)` and
`Player.removeListener(EventListener)` out of `Player` into subclasses.
* Fix `mediaMetadata` being reset when media is
repeated ([#9458](https://github.com/google/ExoPlayer/issues/9458)).
* Video:
* Fix bug in `MediaCodecVideoRenderer` that resulted in re-using a
released `Surface` when playing without an app-provided `Surface`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,8 @@ private void updatePlaybackInfo(
}
newMediaMetadata = mediaItem != null ? mediaItem.mediaMetadata : MediaMetadata.EMPTY;
}
if (!previousPlaybackInfo.staticMetadata.equals(newPlaybackInfo.staticMetadata)) {
if (mediaItemTransitioned
|| !previousPlaybackInfo.staticMetadata.equals(newPlaybackInfo.staticMetadata)) {
newMediaMetadata =
newMediaMetadata.buildUpon().populateFromMetadata(newPlaybackInfo.staticMetadata).build();
}
Expand Down

0 comments on commit e335022

Please sign in to comment.