From 2c754d52e8b712fb6c79412262efd06340838e21 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 24 Sep 2004 10:02:19 +0000 Subject: [PATCH] Merged 2193:2195 --- ChangeLog | 5 +++++ src/common/chapter_parser_xml.cpp | 23 +++++++++++++++++++++++ tests/results.txt | 8 ++++---- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a089e9c95..179dbbbbd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-24 Moritz Bunkus + + * mkvmerge: bug fix: Older Matroska files containing chapters + caused mkvmerge to abort muxing. + 2004-09-21 Moritz Bunkus * mkvmerge: bug fix: mkvmerge was only copying the last tag of a diff --git a/src/common/chapter_parser_xml.cpp b/src/common/chapter_parser_xml.cpp index f4e302ae3..bf09ee52b 100644 --- a/src/common/chapter_parser_xml.cpp +++ b/src/common/chapter_parser_xml.cpp @@ -330,12 +330,35 @@ fix_mandatory_chapter_elements(EbmlElement *e) { GetChild(ee); GetChild(ee); GetChild(ee); + if (FINDFIRST(&ee, KaxEditionUID) == NULL) + *static_cast(&GetChild(ee)) = + create_unique_uint32(UNIQUE_EDITION_IDS); } else if (dynamic_cast(e) != NULL) { KaxChapterAtom &a = *static_cast(e); GetChild(a); GetChild(a); + if (FINDFIRST(&a, KaxChapterUID) == NULL) + *static_cast(&GetChild(a)) = + create_unique_uint32(UNIQUE_CHAPTER_IDS); + if (FINDFIRST(&a, KaxChapterTimeStart) == NULL) + *static_cast(&GetChild(a)) = 0; + + } else if (dynamic_cast(e) != NULL) { + KaxChapterTrack &t = *static_cast(e); + + if (FINDFIRST(&t, KaxChapterTrackNumber) == NULL) + *static_cast(&GetChild(t)) = 0; + + } else if (dynamic_cast(e) != NULL) { + KaxChapterDisplay &d = *static_cast(e); + + if (FINDFIRST(&d, KaxChapterString) == NULL) + *static_cast(&GetChild(d)) = L""; + if (FINDFIRST(&d, KaxChapterLanguage) == NULL) + *static_cast(&GetChild(d)) = "und"; + } if (dynamic_cast(e) != NULL) { diff --git a/tests/results.txt b/tests/results.txt index 959a01bcb..d930efef0 100644 --- a/tests/results.txt +++ b/tests/results.txt @@ -14,17 +14,17 @@ T_013vobsubs:8983288ea21b811fbb85d2ea272ccfe5:passed:20040825-175700 T_014splitting_by_size:fcd11d09729895d83f6882b76f42a1b1-4c3b819f3c2c235cfe916157e143e47e:passed:20040825-175700 T_015splitting_by_time:9b0be8cdb7f9e71d85b181a88de9bcfd-06bb2248071ffdad31051845ba3bc0cb:passed:20040825-175700 T_016cuesheet:36b2caef2575769b68389dcb81b27bf0:passed:20040825-175700 -T_017chapters:eec174c93b6b58533d22889c9d154d7b-4fff45a76f54708f881312aca04fd887:passed:20040825-175700 +T_017chapters:990b4b6b0931b7d52e589f715c919e10-4fff45a76f54708f881312aca04fd887:passed:20040825-175700 T_018attachments:bac27359516bab4984df3021aa295213-7e8e1f17615f157db0e98fba9ad88bad:passed:20040825-175700 T_019attachments2:ecb20381a0cd854909efd90abccc2cd2-80f3bd226b3aa121df27da2981a4b21f-ecb20381a0cd854909efd90abccc2cd2-4c3b819f3c2c235cfe916157e143e47e:passed:20040825-175700 -T_020languages:d7727f857261119496318d8492a8a483:passed:20040825-234208 +T_020languages:dc7b370dbe8c60851a5c76a18ef3768b:passed:20040825-234208 T_021aspect_ratio:7af421f7f38723f6821b53577cb26b74-99d2e3c3e92c5a00883e468ce8285c35:passed:20040825-234244 T_022display_dimensions:57551eda83dd4b149c6f5a5c6da5ce8f:passed:20040825-234339 -T_023no_x:c560612603be92dc9e68203f4668acdc-f350a433d5e1e2073519e71ea7a19f71-e4cfdd0d8237e2dc2ba48777f2ca120a:passed:20040825-234343 +T_023no_x:718a4efee813ebfe7efee93c8e6a3296-f350a433d5e1e2073519e71ea7a19f71-cbfebbc09ce8b5395f42f8989c0bd3ba:passed:20040825-234343 T_024sync_mp3:a6c35d309947a52196d2a5428f87224a-6a638028d795bd48db95446f3521c302:passed:20040825-234344 T_025sync_vorbis:e9d13a6b769cf6c2e4987bf6bd160698-51fcfab150642a66484d3c6bedff697a:passed:20040825-234344 T_026sync_pcm:f337f057c059d771128206c0da3d4807-9b559191edb65655e49186c302c4b815:passed:20040825-234346 -T_027default_track:95ae62c7cfa3bf8797f899e64661544d:passed:20040825-234348 +T_027default_track:b8c4154c98a252d1ff68d885a2a5590f:passed:20040825-234348 T_028compression:f6c15855e42e5a0e80d22a2060ae13e8:passed:20040825-234348 T_029link:b3076d997bcdb4202de374ba77a2a5c6:passed:20040825-235039 T_032cues:2d852a5c1ee169ddc713318c86a0b616:passed:20040825-235040