diff --git a/src/tags/master_playlist/media.rs b/src/tags/master_playlist/media.rs index f43e73f..f1906e8 100644 --- a/src/tags/master_playlist/media.rs +++ b/src/tags/master_playlist/media.rs @@ -127,12 +127,11 @@ impl ExtXMediaBuilder { return Err(Error::unexpected_attribute("INSTREAM-ID").to_string()); } - if self.is_default.unwrap_or(false) && !self.is_autoselect.unwrap_or(false) { - return Err(Error::custom(format!( - "If `DEFAULT` is true, `AUTOSELECT` has to be true too, Default: {:?}, Autoselect: {:?}!", - self.is_default, self.is_autoselect - )) - .to_string()); + if self.is_default.unwrap_or(false) && !self.is_autoselect.unwrap_or(true) { + return Err( + Error::custom("If `DEFAULT` is true and `AUTOSELECT` is present, \ + `AUTOSELECT` has to be true too!").to_string(), + ); } if media_type != MediaType::Subtitles && self.is_forced.is_some() {