mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-14 21:15:06 +00:00
fix(manifests): keep service drm, rebase carried vtt cues, ship single-track mpds
DASH no longer drops service-set DRM when the manifest has none, and the WebVTT rebase allows a cue that starts one segment early. --remote also sends single-track manifests matched by track id.
This commit is contained in:
@@ -72,10 +72,46 @@ def test_detached_adaptation_set_round_trips() -> None:
|
||||
assert client_track.descriptor == Subtitle.Descriptor.DASH
|
||||
|
||||
|
||||
def test_single_track_manifest_round_trips_by_id() -> None:
|
||||
"""A manifest that holds only its own track ships as a fragment, so the client needs no attribute match."""
|
||||
manifest = etree.fromstring(MPD.encode())
|
||||
period = manifest.find("Period")
|
||||
adaptation_set = period.find("AdaptationSet")
|
||||
track = Subtitle(
|
||||
id_="abc123",
|
||||
url="https://cdn.example/manifest.mpd",
|
||||
codec=Subtitle.Codec.WebVTT,
|
||||
language=Language.get("en"),
|
||||
sdh=True,
|
||||
descriptor=Subtitle.Descriptor.DASH,
|
||||
data={
|
||||
"dash": {
|
||||
"manifest": manifest,
|
||||
"period": period,
|
||||
"adaptation_set": adaptation_set,
|
||||
"representation": adaptation_set.find("Representation"),
|
||||
}
|
||||
},
|
||||
)
|
||||
client_track = Subtitle(
|
||||
id_="abc123",
|
||||
url=track.url,
|
||||
codec=Subtitle.Codec.WebVTT,
|
||||
language=Language.get("en"),
|
||||
sdh=True,
|
||||
descriptor=Subtitle.Descriptor.URL,
|
||||
)
|
||||
resolve_track_manifests(Tracks([client_track]), extract_track_manifests(Tracks([track])))
|
||||
|
||||
assert client_track.descriptor == Subtitle.Descriptor.DASH
|
||||
assert client_track.data["dash"]["representation_id"] == "sub-0"
|
||||
|
||||
|
||||
def test_in_tree_adaptation_set_is_not_shipped() -> None:
|
||||
manifest = etree.fromstring(MPD.encode())
|
||||
period = manifest.find("Period")
|
||||
adaptation_set = period.find("AdaptationSet")
|
||||
adaptation_set.append(etree.fromstring(b'<Representation id="sub-1" bandwidth="2000"/>'))
|
||||
track = Subtitle(
|
||||
id_="abc123",
|
||||
url="https://cdn.example/manifest.mpd",
|
||||
|
||||
Reference in New Issue
Block a user