From 346aa044b0f747ddd01cb5722899e45db2b9d109 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 9 Mar 2004 22:08:35 +0000 Subject: [PATCH] Keep tags when reading Matroska files. --- ChangeLog | 3 +++ TODO | 2 -- src/input/r_matroska.cpp | 6 ++++++ src/pr_generic.cpp | 8 +++++--- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a89aa79d..0e496a566 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-03-09 Moritz Bunkus + * mkvmerge: new feature: Tags are being kept when reading Matroska + files. + * mkvmerge: bug fix: Large values for --sync (over 2100) would cause an integer overflow resulting in no sync being done at all. diff --git a/TODO b/TODO index b8edb4cbe..2d5d2dfda 100644 --- a/TODO +++ b/TODO @@ -6,6 +6,4 @@ In no particular order: * mvkmerge: -- Keep tags when reading from Matroska files. - - Split packed video stuff into proper B frames. diff --git a/src/input/r_matroska.cpp b/src/input/r_matroska.cpp index 13a9b646a..616b67ca0 100644 --- a/src/input/r_matroska.cpp +++ b/src/input/r_matroska.cpp @@ -1460,6 +1460,10 @@ kax_reader_c::create_packetizer(int64_t tid) { if (nti->track_name == NULL) nti->track_name = safestrdup(t->track_name); nti->id = t->tnum; // ID for this track. + if (t->tag != NULL) { + nti->tags = new KaxTags; + nti->tags->PushElement(*t->tag); + } if (hack_engaged(ENGAGE_FORCE_PASSTHROUGH_PACKETIZER)) { init_passthrough_packetizer(t); @@ -1655,6 +1659,8 @@ kax_reader_c::create_packetizer(int64_t tid) { break; } set_packetizer_headers(t); + if (t->tag != NULL) + nti->tags->Remove(0); delete nti; } } diff --git a/src/pr_generic.cpp b/src/pr_generic.cpp index 749ba6e56..f0396c8d8 100644 --- a/src/pr_generic.cpp +++ b/src/pr_generic.cpp @@ -77,7 +77,7 @@ generic_packetizer_c::generic_packetizer_c(generic_reader_c *nreader, ti->async.linear = 1.0; ti->async.displacement = 0; } else - ti->async.displacement *= 1000000; // ms to ns + ti->async.displacement *= (int64_t)1000000; // ms to ns initial_displacement = ti->async.displacement; ti->async.displacement = 0; @@ -1155,8 +1155,10 @@ track_info_c &track_info_c::operator =(const track_info_c &src) { for (i = 0; i < src.all_tags->size(); i++) (*all_tags)[i].file_name = safestrdup((*src.all_tags)[i].file_name); tags_ptr = src.tags_ptr; - tags = NULL; -// tags = src.tags; + if (src.tags != NULL) + tags = static_cast(src.tags->Clone()); + else + tags = NULL; aac_is_sbr = new vector(*src.aac_is_sbr);