A fix for CLOSED-CAPTIONS=NONE case and a few minor fixes

The PR includes 
* a hotfix for issue #44. I'm not entirely sure and it's possible to
* `#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.  
* minor `cargo clippy` suggestions
This commit is contained in:
Vadim Getmanshchuk 2022-04-07 13:35:02 -07:00 committed by Vadim Getmanshchuk
parent 39b52a1d4b
commit 3c8368f9a3

View file

@ -176,7 +176,12 @@ impl VariantStream {
self.write_stream_inf_common_attributes(w)?;
write_some_attribute_quoted!(w, ",AUDIO", &self.audio)?;
write_some_attribute_quoted!(w, ",SUBTITLES", &self.subtitles)?;
write_some_attribute_quoted!(w, ",CLOSED-CAPTIONS", &self.closed_captions)?;
// handle `CLOSED-CAPTIONS=NONE` case
if self.closed_captions.as_deref().eq(&Some("NONE")) {
write_some_attribute!(w, ",CLOSED-CAPTIONS", &self.closed_captions)?;
} else {
write_some_attribute_quoted!(w, ",CLOSED-CAPTIONS", &self.closed_captions)?;
}
writeln!(w)?;
writeln!(w, "{}", self.uri)
}