diff --git a/NEWS.md b/NEWS.md index 01b39372a..5535d72d5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -22,6 +22,8 @@ * mkvmerge, mkvpropedit: added support for chapters in WebM files that is spec-compliant by removing all tag elements not supported by the WebM spec. Implements #2002. +* mkvpropedit: added support for tags in WebM files that is spec-compliant by + removing all tag elements not supported by the WebM spec. ## Bug fixes diff --git a/src/propedit/tag_target.cpp b/src/propedit/tag_target.cpp index 04f06975f..177088e6b 100644 --- a/src/propedit/tag_target.cpp +++ b/src/propedit/tag_target.cpp @@ -162,11 +162,15 @@ tag_target_c::execute() { else assert(false); - if (m_level1_element->ListSize()) { - mtx::tags::fix_mandatory_elements(m_level1_element); - if (!m_level1_element->CheckMandatory()) - mxerror(boost::format(Y("Error parsing the tags in '%1%': some mandatory elements are missing.\n")) % m_file_name); - } + if (!m_level1_element->ListSize()) + return; + + mtx::tags::fix_mandatory_elements(m_level1_element); + if (!m_level1_element->CheckMandatory()) + mxerror(boost::format(Y("Error parsing the tags in '%1%': some mandatory elements are missing.\n")) % m_file_name); + + if (m_analyzer->is_webm()) + mtx::tags::remove_elements_unsupported_by_webm(*m_level1_element); } void @@ -391,3 +395,15 @@ tag_target_c::has_content_been_modified() const { return m_tags_modified; } + +bool +tag_target_c::write_elements_set_to_default_value() + const { + return !m_analyzer->is_webm(); +} + +bool +tag_target_c::add_mandatory_elements_if_missing() + const { + return false; +} diff --git a/src/propedit/tag_target.h b/src/propedit/tag_target.h index 2ff7f5fb1..523db6f32 100644 --- a/src/propedit/tag_target.h +++ b/src/propedit/tag_target.h @@ -60,6 +60,8 @@ public: virtual bool has_content_been_modified() const override; virtual void execute() override; + virtual bool write_elements_set_to_default_value() const override; + virtual bool add_mandatory_elements_if_missing() const override; protected: virtual void add_or_replace_global_tags(KaxTags *tags);