Skip to content

Commit

Permalink
Handle metadata failing to decode in MetadataRenderer
Browse files Browse the repository at this point in the history
Issue: #5149
PiperOrigin-RevId: 223121651
  • Loading branch information
andrewlewis committed Nov 28, 2018
1 parent 05a79a4 commit 510749f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* Do not retry failed loads whose error is `FileNotFoundException`.
* Fix issue with applying the `show_buffering` attribute in `PlayerView`
([#5139](https://github.com/google/ExoPlayer/issues/5139)).
* Fix issue where null `Metadata` was output when it failed to decode
([#5149](https://github.com/google/ExoPlayer/issues/5149)).

### 2.9.1 ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,12 @@ public void render(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackEx
buffer.subsampleOffsetUs = formatHolder.format.subsampleOffsetUs;
buffer.flip();
int index = (pendingMetadataIndex + pendingMetadataCount) % MAX_PENDING_METADATA_COUNT;
pendingMetadata[index] = decoder.decode(buffer);
pendingMetadataTimestamps[index] = buffer.timeUs;
pendingMetadataCount++;
Metadata metadata = decoder.decode(buffer);
if (metadata != null) {
pendingMetadata[index] = metadata;
pendingMetadataTimestamps[index] = buffer.timeUs;
pendingMetadataCount++;
}
}
}
}
Expand Down

0 comments on commit 510749f

Please sign in to comment.