Skip to content

Commit

Permalink
Update period index in DashMediaPeriod event dispatcher after manifes…
Browse files Browse the repository at this point in the history
…t update.

Issue:#4492

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205636634
  • Loading branch information
tonihei authored and ojw28 committed Jul 23, 2018
1 parent 0b3fa51 commit 97e66ef
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
private final DashChunkSource.Factory chunkSourceFactory;
private final @Nullable TransferListener<? super DataSource> transferListener;
private final int minLoadableRetryCount;
private final EventDispatcher eventDispatcher;
private final long elapsedRealtimeOffset;
private final LoaderErrorThrower manifestLoaderErrorThrower;
private final Allocator allocator;
Expand All @@ -75,6 +74,7 @@
private final IdentityHashMap<ChunkSampleStream<DashChunkSource>, PlayerTrackEmsgHandler>
trackEmsgHandlerBySampleStream;

private EventDispatcher eventDispatcher;
private @Nullable Callback callback;
private ChunkSampleStream<DashChunkSource>[] sampleStreams;
private EventSampleStream[] eventSampleStreams;
Expand Down Expand Up @@ -131,6 +131,13 @@ public DashMediaPeriod(
*/
public void updateManifest(DashManifest manifest, int periodIndex) {
this.manifest = manifest;
if (this.periodIndex != periodIndex) {
eventDispatcher =
eventDispatcher.withParameters(
/* windowIndex= */ 0,
eventDispatcher.mediaPeriodId.copyWithPeriodIndex(periodIndex),
manifest.getPeriod(periodIndex).startMs);
}
this.periodIndex = periodIndex;
playerEmsgHandler.updateManifest(manifest);
if (sampleStreams != null) {
Expand Down

0 comments on commit 97e66ef

Please sign in to comment.