mirror of
https://github.com/androidx/media.git
synced 2025-05-16 20:19:57 +08: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
@ -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…
x
Reference in New Issue
Block a user