Possible NullPointerException in ExoPlayerImplInternal.setRepeatModeInternal

When readingPeriodHolder and playingPeriodHolder are both null, a
NullPointerException is thrown when trying to reassign readingPeriodHolder.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155635846
This commit is contained in:
tonihei 2017-05-10 09:18:01 -07:00 committed by Oliver Woodman
parent a6220b8be3
commit c0d16ea2cb

View File

@ -454,7 +454,7 @@ import java.io.IOException;
if (!seenLoadingPeriodHolder) {
loadingPeriodHolder = lastValidPeriodHolder;
}
if (!seenReadingPeriodHolder) {
if (!seenReadingPeriodHolder && playingPeriodHolder != null) {
// Renderers may have read from a period that's been removed. Seek back to the current
// position of the playing period to make sure none of the removed period is played.
int playingPeriodIndex = playingPeriodHolder.index;