mirror of
https://github.com/androidx/media.git
synced 2025-04-29 22:36:54 +08:00
Ensure chunk duration is set in CmcdData
for HLS media
Previously, encrypted media segments did not have the chunk duration set, causing an assertion failure during `CmcdData` creation. With this change, the chunk duration is always set, while `CmcdData` ensures it is applied only for media chunks. Issue: androidx/media#2312 PiperOrigin-RevId: 745196718 (cherry picked from commit 9182b413dc6e14ed06817d8ad4ae65ce01d85f1b)
This commit is contained in:
parent
82d7c628da
commit
f35c59b176
@ -77,6 +77,9 @@
|
||||
* Cronet extension:
|
||||
* RTMP extension:
|
||||
* HLS extension:
|
||||
* Fix issue where chunk duration wasn't set in `CmcdData` for HLS media,
|
||||
causing an assertion failure when processing encrypted media segments
|
||||
([#2312](https://github.com/androidx/media/issues/2312)).
|
||||
* DASH extension:
|
||||
* Smooth Streaming extension:
|
||||
* RTSP extension:
|
||||
|
@ -517,7 +517,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
.setPlaybackRate(loadingInfo.playbackSpeed)
|
||||
.setIsLive(!playlist.hasEndTag)
|
||||
.setDidRebuffer(loadingInfo.rebufferedSince(lastChunkRequestRealtimeMs))
|
||||
.setIsBufferEmpty(queue.isEmpty());
|
||||
.setIsBufferEmpty(queue.isEmpty())
|
||||
.setChunkDurationUs(segmentBaseHolder.segmentBase.durationUs);
|
||||
long nextMediaSequence =
|
||||
segmentBaseHolder.partIndex == C.INDEX_UNSET
|
||||
? segmentBaseHolder.mediaSequence + 1
|
||||
|
@ -112,8 +112,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
.setFlags(segmentBaseHolder.isPreload ? FLAG_MIGHT_NOT_USE_FULL_NETWORK_SPEED : 0)
|
||||
.build();
|
||||
if (cmcdDataFactory != null) {
|
||||
CmcdData cmcdData =
|
||||
cmcdDataFactory.setChunkDurationUs(mediaSegment.durationUs).createCmcdData();
|
||||
CmcdData cmcdData = cmcdDataFactory.createCmcdData();
|
||||
dataSpec = cmcdData.addToDataSpec(dataSpec);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user