mirror of
https://github.com/samsonjs/media.git
synced 2026-04-01 10:35:48 +00:00
Use consistent identifiers for extractor periods.
Also, fix clearing the timeline for source info changes. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130292700
This commit is contained in:
parent
80227840f6
commit
63ab601d75
2 changed files with 5 additions and 1 deletions
|
|
@ -821,6 +821,8 @@ import java.io.IOException;
|
|||
// Release all loaded periods and seek to the new playing period index.
|
||||
releasePeriodsFrom(playingPeriod);
|
||||
playingPeriod = null;
|
||||
readingPeriod = null;
|
||||
loadingPeriod = null;
|
||||
|
||||
MediaSource.Position defaultStartPosition =
|
||||
mediaSource.getDefaultStartPosition(newPlayingPeriodIndex);
|
||||
|
|
@ -851,6 +853,8 @@ import java.io.IOException;
|
|||
index = playingPeriod.index;
|
||||
releasePeriodsFrom(playingPeriod);
|
||||
playingPeriod = null;
|
||||
readingPeriod = null;
|
||||
loadingPeriod = null;
|
||||
seekToPeriodPosition(index, 0);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public final class ExtractorMediaSource implements MediaSource, MediaSource.List
|
|||
@Override
|
||||
public void prepareSource(MediaSource.Listener listener) {
|
||||
sourceListener = listener;
|
||||
timeline = new SinglePeriodTimeline(this, C.UNSET_TIME_US, false);
|
||||
timeline = new SinglePeriodTimeline(0, C.UNSET_TIME_US, false);
|
||||
listener.onSourceInfoRefreshed(timeline, null);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue