mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Update period index in DashMediaPeriod event dispatcher after manifest update.
Issue:#4492 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=205636634
This commit is contained in:
parent
0b3fa5176a
commit
97e66ef11b
@ -64,7 +64,6 @@ import java.util.List;
|
|||||||
private final DashChunkSource.Factory chunkSourceFactory;
|
private final DashChunkSource.Factory chunkSourceFactory;
|
||||||
private final @Nullable TransferListener<? super DataSource> transferListener;
|
private final @Nullable TransferListener<? super DataSource> transferListener;
|
||||||
private final int minLoadableRetryCount;
|
private final int minLoadableRetryCount;
|
||||||
private final EventDispatcher eventDispatcher;
|
|
||||||
private final long elapsedRealtimeOffset;
|
private final long elapsedRealtimeOffset;
|
||||||
private final LoaderErrorThrower manifestLoaderErrorThrower;
|
private final LoaderErrorThrower manifestLoaderErrorThrower;
|
||||||
private final Allocator allocator;
|
private final Allocator allocator;
|
||||||
@ -75,6 +74,7 @@ import java.util.List;
|
|||||||
private final IdentityHashMap<ChunkSampleStream<DashChunkSource>, PlayerTrackEmsgHandler>
|
private final IdentityHashMap<ChunkSampleStream<DashChunkSource>, PlayerTrackEmsgHandler>
|
||||||
trackEmsgHandlerBySampleStream;
|
trackEmsgHandlerBySampleStream;
|
||||||
|
|
||||||
|
private EventDispatcher eventDispatcher;
|
||||||
private @Nullable Callback callback;
|
private @Nullable Callback callback;
|
||||||
private ChunkSampleStream<DashChunkSource>[] sampleStreams;
|
private ChunkSampleStream<DashChunkSource>[] sampleStreams;
|
||||||
private EventSampleStream[] eventSampleStreams;
|
private EventSampleStream[] eventSampleStreams;
|
||||||
@ -131,6 +131,13 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public void updateManifest(DashManifest manifest, int periodIndex) {
|
public void updateManifest(DashManifest manifest, int periodIndex) {
|
||||||
this.manifest = manifest;
|
this.manifest = manifest;
|
||||||
|
if (this.periodIndex != periodIndex) {
|
||||||
|
eventDispatcher =
|
||||||
|
eventDispatcher.withParameters(
|
||||||
|
/* windowIndex= */ 0,
|
||||||
|
eventDispatcher.mediaPeriodId.copyWithPeriodIndex(periodIndex),
|
||||||
|
manifest.getPeriod(periodIndex).startMs);
|
||||||
|
}
|
||||||
this.periodIndex = periodIndex;
|
this.periodIndex = periodIndex;
|
||||||
playerEmsgHandler.updateManifest(manifest);
|
playerEmsgHandler.updateManifest(manifest);
|
||||||
if (sampleStreams != null) {
|
if (sampleStreams != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user