mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-04 01:03:33 +00:00
b26c23c61e
There are elements in Matroska that are mandatory, have a default value and may occur multiple times within the same master, mainly the "chapter language" element. The semantics in such a case are that the default value must only be used if NO OTHER element of the same type is present within the same master element. If a "chapter display" contains, let's say, a string for the languages German & English, two "chapter language" elements must be used. Checking with the specs reveals that English is the default value for "chapter languages". Therefore one might think we can omit writing the instance for "chapter language" with value "English". But that would leave one "chapter language" element present with "German" as the value, and semantically that would be the value a reader must use. This patch changes how default elements are removed before writing a master element. It now iterates over all elements keeping track of how many elements of each type there are within the same master. Mandatory elements set to their default value will now only then be removed if there is only that one instance of the mandatory element. Part of the fix of #3120.
16 lines
414 B
Ruby
Executable File
16 lines
414 B
Ruby
Executable File
#!/usr/bin/ruby -w
|
|
|
|
# T_721mutli_chapter_language
|
|
src = "data/subtitles/srt/ven.srt"
|
|
chapters = "data/chapters/multi-language-in-display.xml"
|
|
|
|
describe "mkvmerge & mkvpropedit / chapter display with multiple chapter language, one of them 'eng'"
|
|
|
|
test_merge src, :args => "--chapters #{chapters}"
|
|
test_merge src, :keep_tmp => true
|
|
|
|
test "mkvpropedit" do
|
|
propedit tmp, "--chapters #{chapters}"
|
|
hash_tmp
|
|
end
|