From 2f92e3ae8c06a4ff346a6567bd275aa90c9541d3 Mon Sep 17 00:00:00 2001 From: Vadim Getmanshchuk Date: Fri, 8 Apr 2022 16:27:04 -0700 Subject: [PATCH] `#EXT-X-ENDLIST` is moved to be the last part of the media manifest. Theoretically it can appear anywhere in manifest, so the current placement is not breaking the standard, but not usually is what found in the wild and I believe will help with readability. As any placement is possible, the placement at the end is completely legal. --- src/playlist.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/playlist.rs b/src/playlist.rs index 2d72fcd..6b25548 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -437,9 +437,6 @@ impl MediaPlaylist { self.discontinuity_sequence )?; } - if self.end_list { - writeln!(w, "#EXT-X-ENDLIST")?; - } if let Some(ref v) = self.playlist_type { writeln!(w, "#EXT-X-PLAYLIST-TYPE:{}", v)?; } @@ -455,6 +452,9 @@ impl MediaPlaylist { for segment in &self.segments { segment.write_to(w)?; } + if self.end_list { + writeln!(w, "#EXT-X-ENDLIST")?; + } Ok(()) }