Skip to content

Commit 0d35b0d

Browse files
committed
Start HLS ladders at source rendition
1 parent 6dc586d commit 0d35b0d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

services/rend-api/src/media.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,9 @@ fn hls_renditions_for_source(source_probe: &SourceProbe) -> Vec<HlsRendition> {
10051005
.iter()
10061006
.position(|rendition| rendition.resolution_tier == source_probe.resolution_tier)
10071007
.unwrap_or(0);
1008-
HLS_RENDITIONS[..=source_tier_index].to_vec()
1008+
let mut renditions = HLS_RENDITIONS[..=source_tier_index].to_vec();
1009+
renditions.reverse();
1010+
renditions
10091011
}
10101012

10111013
fn hls_video_label(rendition: &HlsRendition) -> String {
@@ -1328,15 +1330,15 @@ mod tests {
13281330
.iter()
13291331
.map(|rendition| rendition.name)
13301332
.collect::<Vec<_>>(),
1331-
vec!["720p", "1080p"]
1333+
vec!["1080p", "720p"]
13321334
);
13331335
assert_eq!(
13341336
hls_variant_stream_map(&renditions, true),
1335-
"v:0,a:0,name:720p v:1,a:1,name:1080p"
1337+
"v:0,a:0,name:1080p v:1,a:1,name:720p"
13361338
);
13371339
assert_eq!(
13381340
hls_variant_stream_map(&renditions, false),
1339-
"v:0,name:720p v:1,name:1080p"
1341+
"v:0,name:1080p v:1,name:720p"
13401342
);
13411343
}
13421344

0 commit comments

Comments
 (0)