mirror of
https://github.com/rutgersc/m3u8-rs.git
synced 2025-03-14 02:02:39 +00:00
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:
parent
39b52a1d4b
commit
3c8368f9a3
1 changed files with 6 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue