Fix bug: playback is frozen with HLS chunkless preparation

This change fixes a bug where the player is frozen with HLS chunkless
preparation because the audio stream wrappers are not marked as master
timestamp sources before preparation.

#minor-release

PiperOrigin-RevId: 453941815
This commit is contained in:
christosts 2022-06-09 16:19:51 +00:00 committed by Marc Baechinger
parent 12d775f055
commit 9221eeb2d8

View File

@ -555,8 +555,10 @@ public final class HlsMediaPeriod
this.sampleStreamWrappers = sampleStreamWrappers.toArray(new HlsSampleStreamWrapper[0]); this.sampleStreamWrappers = sampleStreamWrappers.toArray(new HlsSampleStreamWrapper[0]);
this.manifestUrlIndicesPerWrapper = manifestUrlIndicesPerWrapper.toArray(new int[0][]); this.manifestUrlIndicesPerWrapper = manifestUrlIndicesPerWrapper.toArray(new int[0][]);
pendingPrepareCount = this.sampleStreamWrappers.length; pendingPrepareCount = this.sampleStreamWrappers.length;
// Set timestamp master and trigger preparation (if not already prepared) // Set timestamp masters and trigger preparation (if not already prepared)
this.sampleStreamWrappers[0].setIsTimestampMaster(true); for (int i = 0; i < audioVideoSampleStreamWrapperCount; i++) {
this.sampleStreamWrappers[i].setIsTimestampMaster(true);
}
for (HlsSampleStreamWrapper sampleStreamWrapper : this.sampleStreamWrappers) { for (HlsSampleStreamWrapper sampleStreamWrapper : this.sampleStreamWrappers) {
sampleStreamWrapper.continuePreparing(); sampleStreamWrapper.continuePreparing();
} }