Commit b37773c5 by tonihei Committed by Oliver Woodman

Keep ExtractorMediaSource duration for repreparation.

This allows to know the duration immediately and fixes the temporary unknown
duration in the UI when repreparing the same extractor media source.

The isSeekable property is still reset to false as we can't actually seek
until the seek map has been reloaded.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188145860
parent e9f36f06
......@@ -319,11 +319,12 @@ public final class ExtractorMediaSource extends BaseMediaSource
this.eventDispatcher = new EventDispatcher(eventHandler, eventListener);
this.customCacheKey = customCacheKey;
this.continueLoadingCheckIntervalBytes = continueLoadingCheckIntervalBytes;
this.timelineDurationUs = C.TIME_UNSET;
}
@Override
public void prepareSourceInternal(ExoPlayer player, boolean isTopLevelSource) {
notifySourceInfoRefreshed(C.TIME_UNSET, false);
notifySourceInfoRefreshed(timelineDurationUs, /* isSeekable= */ false);
}
@Override
......
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