From 958b73fdf59dbda695a236ca4e34762d7be9ee7e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 21 Sep 2004 12:41:42 +0000 Subject: [PATCH] Merged 2190 --- ChangeLog | 5 +++++ src/input/r_matroska.cpp | 18 +++++++----------- src/input/r_matroska.h | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc99ffb25..a089e9c95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-21 Moritz Bunkus + + * mkvmerge: bug fix: mkvmerge was only copying the last tag of a + list of tags applying to a track from a Matroska file. + 2004-09-17 Moritz Bunkus * mkvmerge: bug fix: mkvmerge will show a nice warning if the diff --git a/src/input/r_matroska.cpp b/src/input/r_matroska.cpp index d3d240dc3..1b5c39e99 100644 --- a/src/input/r_matroska.cpp +++ b/src/input/r_matroska.cpp @@ -164,8 +164,8 @@ kax_reader_c::~kax_reader_c() { delete tracks[i]->lzo1x_compressor; if (tracks[i]->kax_c_encodings != NULL) delete tracks[i]->kax_c_encodings; - if (tracks[i]->tag != NULL) - delete tracks[i]->tag; + if (tracks[i]->tags != NULL) + delete tracks[i]->tags; safefree(tracks[i]); } @@ -768,9 +768,9 @@ kax_reader_c::handle_tags(mm_io_c *io, track = find_track_by_uid(uint32(*tuid)); if (track != NULL) { found = true; - if (track->tag != NULL) - delete track->tag; - track->tag = tag; + if (track->tags == NULL) + track->tags = new KaxTags; + track->tags->PushElement(*tag); } } } else @@ -1493,10 +1493,8 @@ 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 (t->tags != NULL) + nti->tags = dynamic_cast(t->tags->Clone()); if (hack_engaged(ENGAGE_FORCE_PASSTHROUGH_PACKETIZER)) { init_passthrough_packetizer(t); @@ -1712,8 +1710,6 @@ 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/input/r_matroska.h b/src/input/r_matroska.h index fd067a41b..d0f0a3c30 100644 --- a/src/input/r_matroska.h +++ b/src/input/r_matroska.h @@ -101,7 +101,7 @@ typedef struct { compression_c *zlib_compressor, *bzlib_compressor, *lzo1x_compressor; - KaxTag *tag; + KaxTags *tags; int ptzr; bool headers_set;