Matroska-Org / libmatroska

a C++ libary to parse Matroska files (.mkv and .mka)
GNU Lesser General Public License v2.1
313 stars 57 forks source link

Don't allow to write deprecated elements #156

Open robUx4 opened 6 months ago

robUx4 commented 6 months ago

On top of #148, only the last 2 commits matter here. Requires https://github.com/Matroska-Org/libebml/pull/207 and https://github.com/Matroska-Org/libebml/pull/210

The RenderData hack is dirty and likely bogus. This uses the write filter calls to always disable the element when trying to write it.

We actually override the CanWrite() method more often (all Matroska elements) than we override RenderData(). Maybe using an interface with multiple class inheritance could avoid this and have one implementation for all of them...