stream.dash: fix old timeline ID workaround #5199
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
stream.dash: fix old timeline ID workaround
When building segment timelines, don't use the
mimeTypeattribute of theSegmentTemplate's parent node as a fallback when the parent'sidattribute is missing.This doesn't work if the parent node is a
Period, as it doesn't have themimeTypeattribute, and it also generates timeline keys which are not unique if two streams of the samemimeTypewould get muxed (currently not supported).Instead, build an
identtuple on theRepresentationinstance consisting of the ids of the parentPeriodandAdaptationSet, and theRepresentationitself, with its requiredidattribute. This ensures a unique key for thetimelinesdict.Then simply pass the
identtuple to theSegmentTemplate.segments()generator, similar to theBaseURLfixes of e684913.stream.dash: refactor DASHStream{Reader,Worker}
Use the newly added
Representation.identfor finding the sameRepresentationafter a manifest reload of a dynamic DASH stream.Also use the worker's
periodattribute instead of the hardcoded zero index, even though only the first period is supported.The missing parent ID workaround was initially implemented in #2096.
There's still a lot to do to fix some of the biggest issues with the DASH implementation. For example, manifest reloads are only attempted once without any retries, and failed manifest reloads or segment downloads can cause a deadlock. And much more...