mirror of
https://github.com/rutgersc/m3u8-rs.git
synced 2024-12-22 14:36:28 +00:00
CODECS should be optional
https://developer.apple.com/documentation/http_live_streaming/example_playlists_for_http_live_streaming/creating_a_master_playlist > While the CODECS parameter is optional, every EXT-X-STREAM-INF tag should include the attribute.
This commit is contained in:
parent
03ec1a4544
commit
31e78801f9
2 changed files with 4 additions and 4 deletions
|
@ -171,7 +171,7 @@ pub struct VariantStream {
|
||||||
// <attribute-list>
|
// <attribute-list>
|
||||||
pub bandwidth: String,
|
pub bandwidth: String,
|
||||||
pub average_bandwidth: Option<String>,
|
pub average_bandwidth: Option<String>,
|
||||||
pub codecs: String,
|
pub codecs: Option<String>,
|
||||||
pub resolution: Option<String>,
|
pub resolution: Option<String>,
|
||||||
pub frame_rate: Option<String>,
|
pub frame_rate: Option<String>,
|
||||||
pub audio: Option<String>,
|
pub audio: Option<String>,
|
||||||
|
@ -190,7 +190,7 @@ impl VariantStream {
|
||||||
uri: attrs.remove("URI").unwrap_or_else(String::new),
|
uri: attrs.remove("URI").unwrap_or_else(String::new),
|
||||||
bandwidth: attrs.remove("BANDWIDTH").unwrap_or_else(String::new),
|
bandwidth: attrs.remove("BANDWIDTH").unwrap_or_else(String::new),
|
||||||
average_bandwidth: attrs.remove("AVERAGE-BANDWIDTH"),
|
average_bandwidth: attrs.remove("AVERAGE-BANDWIDTH"),
|
||||||
codecs: attrs.remove("CODECS").unwrap_or_else(String::new),
|
codecs: attrs.remove("CODECS"),
|
||||||
resolution: attrs.remove("RESOLUTION"),
|
resolution: attrs.remove("RESOLUTION"),
|
||||||
frame_rate: attrs.remove("FRAME-RATE"),
|
frame_rate: attrs.remove("FRAME-RATE"),
|
||||||
audio: attrs.remove("AUDIO"),
|
audio: attrs.remove("AUDIO"),
|
||||||
|
@ -226,7 +226,7 @@ impl VariantStream {
|
||||||
fn write_stream_inf_common_attributes<T: Write>(&self, w: &mut T) -> std::io::Result<()> {
|
fn write_stream_inf_common_attributes<T: Write>(&self, w: &mut T) -> std::io::Result<()> {
|
||||||
write!(w, "BANDWIDTH={}", &self.bandwidth)?;
|
write!(w, "BANDWIDTH={}", &self.bandwidth)?;
|
||||||
write_some_attribute!(w, ",AVERAGE-BANDWIDTH", &self.average_bandwidth)?;
|
write_some_attribute!(w, ",AVERAGE-BANDWIDTH", &self.average_bandwidth)?;
|
||||||
write!(w, ",CODECS=\"{}\"", &self.codecs)?;
|
write_some_attribute_quoted!(w, ",CODECS", &self.codecs)?;
|
||||||
write_some_attribute!(w, ",RESOLUTION", &self.resolution)?;
|
write_some_attribute!(w, ",RESOLUTION", &self.resolution)?;
|
||||||
write_some_attribute!(w, ",FRAME-RATE", &self.frame_rate)?;
|
write_some_attribute!(w, ",FRAME-RATE", &self.frame_rate)?;
|
||||||
write_some_attribute_quoted!(w, ",VIDEO", &self.video)
|
write_some_attribute_quoted!(w, ",VIDEO", &self.video)
|
||||||
|
|
|
@ -278,7 +278,7 @@ fn create_and_parse_master_playlist_full() {
|
||||||
uri: "masterplaylist-uri".into(),
|
uri: "masterplaylist-uri".into(),
|
||||||
bandwidth: "10010010".into(),
|
bandwidth: "10010010".into(),
|
||||||
average_bandwidth: Some("10010010".into()),
|
average_bandwidth: Some("10010010".into()),
|
||||||
codecs: "TheCODEC".into(),
|
codecs: Some("TheCODEC".into()),
|
||||||
resolution: Some("1000x3000".into()),
|
resolution: Some("1000x3000".into()),
|
||||||
frame_rate: Some("60".into()),
|
frame_rate: Some("60".into()),
|
||||||
audio: Some("audio".into()),
|
audio: Some("audio".into()),
|
||||||
|
|
Loading…
Reference in a new issue