Commit 13b595ed by olly Committed by Oliver Woodman

Don't do work after track selection when in ended state

This causes the player to report that it's started loading
when in the ended state.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176371892
parent 275292cb
...@@ -878,7 +878,7 @@ import java.io.IOException; ...@@ -878,7 +878,7 @@ import java.io.IOException;
boolean[] streamResetFlags = new boolean[renderers.length]; boolean[] streamResetFlags = new boolean[renderers.length];
long periodPositionUs = playingPeriodHolder.updatePeriodTrackSelection( long periodPositionUs = playingPeriodHolder.updatePeriodTrackSelection(
playbackInfo.positionUs, recreateStreams, streamResetFlags); playbackInfo.positionUs, recreateStreams, streamResetFlags);
if (periodPositionUs != playbackInfo.positionUs) { if (state != Player.STATE_ENDED && periodPositionUs != playbackInfo.positionUs) {
playbackInfo = playbackInfo.fromNewPosition(playbackInfo.periodId, periodPositionUs, playbackInfo = playbackInfo.fromNewPosition(playbackInfo.periodId, periodPositionUs,
playbackInfo.contentPositionUs); playbackInfo.contentPositionUs);
eventHandler.obtainMessage(MSG_POSITION_DISCONTINUITY, Player.DISCONTINUITY_REASON_INTERNAL, eventHandler.obtainMessage(MSG_POSITION_DISCONTINUITY, Player.DISCONTINUITY_REASON_INTERNAL,
...@@ -923,9 +923,11 @@ import java.io.IOException; ...@@ -923,9 +923,11 @@ import java.io.IOException;
loadingPeriodHolder.updatePeriodTrackSelection(loadingPeriodPositionUs, false); loadingPeriodHolder.updatePeriodTrackSelection(loadingPeriodPositionUs, false);
} }
} }
maybeContinueLoading(); if (state != Player.STATE_ENDED) {
updatePlaybackPositions(); maybeContinueLoading();
handler.sendEmptyMessage(MSG_DO_SOME_WORK); updatePlaybackPositions();
handler.sendEmptyMessage(MSG_DO_SOME_WORK);
}
} }
private boolean isTimelineReady(long playingPeriodDurationUs) { private boolean isTimelineReady(long playingPeriodDurationUs) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment