Use case description
When playing a DASH stream that has two video adaptation sets (for different video codecs) where both adaptation sets contain an inband event stream, metadata is sometimes not surfaced.
The DefaultTrackSelector selects the TrackGroup corresponding to one of the adaptation sets but selects the event stream from the other. This seems to happen purely by chance as the tracks are equivalent according to OtherTrackScore ( no selection flags, same trackFormatSupport) (ref).
As the DashMediaPeriod only creates embedded streams for the selected primary stream (ref), no metadata is exposed through Listener.onMetadata.
Proposed solution
- extend
Format with primaryTrackId in order to enable
- exclude tracks that are embedded in an unselected track from the "other" track selection
Alternatives considered
A hacky workaround that allows identification of embedded TrackGroups is looking at the id's of the TrackGroup. Embedded EventMessage tracks currently always have an id composed of <primaryTrackGroupId>:emsg (ref)