diff --git a/src/lib.rs b/src/lib.rs index 0e47599..11ebf4c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -161,7 +161,7 @@ enum Stream { codec_name: String, codec_long_name: String, channels: usize, - channel_layout: String, + channel_layout: Option, tags: Option, }, #[serde(rename = "subtitle")] @@ -213,7 +213,8 @@ pub struct AudioFormat { short_name: String, long_name: String, channels: usize, - channel_layout: String, + #[serde(skip_serializing_if = "Option::is_none")] + channel_layout: Option, #[serde(skip_serializing_if = "Option::is_none")] title: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -492,7 +493,7 @@ impl MovieLibrary { short_name: codec_name.to_string(), long_name: codec_long_name.to_string(), channels: *channels, - channel_layout: channel_layout.to_string(), + channel_layout: channel_layout.clone(), title: tags.as_ref().and_then(|t| t.title()), language: tags.as_ref().and_then(|t| t.language()), })