Improve #EXT-X-INDEPENDENT-SEGMENTS placement

While it can be anywhere in the playlist as it applies to, this one usually is at the top of the manifest, right after the VERSION tag.
This commit is contained in:
Vadim Getmanshchuk 2022-07-20 22:04:20 -07:00 committed by Sebastian Dröge
parent bd7cce75e9
commit d2881fef08

View file

@ -188,6 +188,9 @@ impl MasterPlaylist {
if let Some(ref v) = self.version {
writeln!(w, "#EXT-X-VERSION:{}", v)?;
}
if self.independent_segments {
writeln!(w, "#EXT-X-INDEPENDENT-SEGMENTS")?;
}
for alternative in &self.alternatives {
alternative.write_to(w)?;
@ -205,9 +208,6 @@ impl MasterPlaylist {
if let Some(ref start) = self.start {
start.write_to(w)?;
}
if self.independent_segments {
writeln!(w, "#EXT-X-INDEPENDENT-SEGMENTS")?;
}
for unknown_tag in &self.unknown_tags {
writeln!(w, "{}", unknown_tag)?;
}
@ -746,6 +746,9 @@ impl MediaPlaylist {
if let Some(ref v) = self.version {
writeln!(w, "#EXT-X-VERSION:{}", v)?;
}
if self.independent_segments {
writeln!(w, "#EXT-X-INDEPENDENT-SEGMENTS")?;
}
writeln!(w, "#EXT-X-TARGETDURATION:{}", self.target_duration)?;
if self.media_sequence != 0 {
@ -767,9 +770,6 @@ impl MediaPlaylist {
if let Some(ref start) = self.start {
start.write_to(w)?;
}
if self.independent_segments {
writeln!(w, "#EXT-X-INDEPENDENT-SEGMENTS")?;
}
for segment in &self.segments {
segment.write_to(w)?;
}