Allow reusing SingleSampleMediaSource.

GitHub:#3498

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183391117
This commit is contained in:
tonihei 2018-01-26 08:08:19 -08:00 committed by Oliver Woodman
parent de8d402aa6
commit f581acbf5d

View file

@ -158,8 +158,6 @@ public final class SingleSampleMediaSource implements MediaSource {
private final boolean treatLoadErrorsAsEndOfStream;
private final Timeline timeline;
private boolean isPrepared;
/**
* @param uri The {@link Uri} of the media stream.
* @param dataSourceFactory The factory from which the {@link DataSource} to read the media will
@ -253,8 +251,6 @@ public final class SingleSampleMediaSource implements MediaSource {
@Override
public void prepareSource(ExoPlayer player, boolean isTopLevelSource, Listener listener) {
Assertions.checkState(!isPrepared, MEDIA_SOURCE_REUSED_ERROR_MESSAGE);
isPrepared = true;
listener.onSourceInfoRefreshed(this, timeline, null);
}