mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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.
|
// Release all loaded periods and seek to the new playing period index.
|
||||||
releasePeriodsFrom(playingPeriod);
|
releasePeriodsFrom(playingPeriod);
|
||||||
playingPeriod = null;
|
playingPeriod = null;
|
||||||
|
readingPeriod = null;
|
||||||
|
loadingPeriod = null;
|
||||||
|
|
||||||
MediaSource.Position defaultStartPosition =
|
MediaSource.Position defaultStartPosition =
|
||||||
mediaSource.getDefaultStartPosition(newPlayingPeriodIndex);
|
mediaSource.getDefaultStartPosition(newPlayingPeriodIndex);
|
||||||
|
|
@ -851,6 +853,8 @@ import java.io.IOException;
|
||||||
index = playingPeriod.index;
|
index = playingPeriod.index;
|
||||||
releasePeriodsFrom(playingPeriod);
|
releasePeriodsFrom(playingPeriod);
|
||||||
playingPeriod = null;
|
playingPeriod = null;
|
||||||
|
readingPeriod = null;
|
||||||
|
loadingPeriod = null;
|
||||||
seekToPeriodPosition(index, 0);
|
seekToPeriodPosition(index, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ public final class ExtractorMediaSource implements MediaSource, MediaSource.List
|
||||||
@Override
|
@Override
|
||||||
public void prepareSource(MediaSource.Listener listener) {
|
public void prepareSource(MediaSource.Listener listener) {
|
||||||
sourceListener = 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);
|
listener.onSourceInfoRefreshed(timeline, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue