open-standards/wai/http-conformance/falsify/render-parts-after-extinf.patch
2026-10-06 07:30:39 -04:00

20 lines
990 B
Diff

# must fail: media_playlist_live_wai_r1_m3u8 playlist_receipt_live_wai_r1_m3u8
# a segment's parts rendered after its EXTINF, not before it (hls_render::render_hls_with)
diff --git a/wai/wai-rs/src/hls_render.rs b/wai/wai-rs/src/hls_render.rs
index 7e29b8dd..0d62afe4 100644
--- a/wai/wai-rs/src/hls_render.rs
+++ b/wai/wai-rs/src/hls_render.rs
@@ -258,12 +258,12 @@ pub fn render_hls_with(segments: &[Segment], r: &HlsRender, extras: &[SegmentExt
if let Some(pdt) = &e.program_date_time {
out.push_str(&format!("#EXT-X-PROGRAM-DATE-TIME:{pdt}\n"));
}
- part_lines(&mut out, &e.parts);
if e.gap {
out.push_str("#EXT-X-GAP\n");
}
// Fixed 3-dp seconds so the byte output is stable across platforms.
out.push_str(&format!("#EXTINF:{},\n", seconds(s.duration_ms)));
+ part_lines(&mut out, &e.parts);
layer_lines(&mut out, &e.layers);
out.push_str(&s.uri);
out.push('\n');