mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-05 15:35:06 +00:00
feat(tracks): add Audio bit_depth and sample_rate from manifests and carry them over remote
This commit is contained in:
@@ -335,6 +335,10 @@ class HLS:
|
||||
track_type: type[Audio] | type[Subtitle]
|
||||
if media.type == "AUDIO":
|
||||
track_type = Audio
|
||||
# BIT-DEPTH and SAMPLE-RATE (RFC 8216bis), which the m3u8 library keeps in extras
|
||||
resolution = {
|
||||
k: int(v) for k in ("bit_depth", "sample_rate") if str(v := media.extras.get(k, "")).isdecimal()
|
||||
}
|
||||
codec: Any = HLS.select_audio_codec(audio_codecs_by_group_id.get(media.group_id), media.uri)
|
||||
if media.channels:
|
||||
# the channel count, then /-separated coding (JOC) and usage identifiers (RFC 8216bis)
|
||||
@@ -376,6 +380,7 @@ class HLS:
|
||||
channels=media.channels,
|
||||
joc=joc,
|
||||
descriptive="public.accessibility.describes-video" in (media.characteristics or ""),
|
||||
**resolution,
|
||||
)
|
||||
if track_type is Audio
|
||||
else dict(
|
||||
|
||||
Reference in New Issue
Block a user