[matroska-devel] tag reading borked?

Moritz Bunkus moritz at bunkus.org
Fri Jul 4 00:44:55 CEST 2003


Heya Steve,

I've experimented with tags, and have the same problems that jcsston
has.

Here's the code to create some dummy comments at the end of a file:

  KaxTags &tags = GetChild<KaxTags>(*kax_segment);
  KaxTag &tag = GetChild<KaxTag>(tags);
  KaxTagTargets &targets = GetChild<KaxTagTargets>(tag);
  *(static_cast<EbmlUInteger *>(&GetChild<KaxTagTrackUID>(targets))) =
    1234;
  *(static_cast<EbmlUInteger *>(&GetChild<KaxTagChapterUID>(targets))) =
    5678;
  KaxTagGeneral &general = GetChild<KaxTagGeneral>(tag);
  *(static_cast<EbmlUnicodeString *>(&GetChild<KaxTagSubject>(general)))
  =
    cstr_to_UTFstring("Subject");
  *(static_cast<EbmlUnicodeString
  *>(&GetChild<KaxTagBibliography>(general))) =
    cstr_to_UTFstring("Bibliography");
  *(static_cast<EbmlString *>(&GetChild<KaxTagLanguage>(general))) =
  "ger";
  tags.Render(*out);

This works. Here's the output of my new mkvinfo:

|+ Tags at 734945
| + Tag at 734950
|  + Targets at 734953
|   + Track UID: 1234 at 734956
|   + Chapter UID: 5678 at 734961
|  + General at 734966
|   + Unknown element: N7libebml15DummyRawElementE at 734969

So the first element that it cannot find is the KaxTagSubject. But this
element IS in the file, and it appears to be OK. Here's a small excerpt
from the hexdump:

000B36E0  00 12 54 C3  67 B3 73 73   B0 63 C0 8A  63 C5 82 04  ..T.g.ss.c..c...
000B36F0  D2 63 C4 82  16 2E 67 C9   A0 29 C1 87  53 75 62 6A  .c....g..)..Subj
000B3700  65 63 74 44  88 8C 42 69   62 6C 69 6F  67 72 61 70  ectD..Bibliograp
000B3710  68 79 22 B5  9C 83 67 65   72                        hy"...ger

The three bytes directly before the Subject are 29 C1 87 which are OK
according to KaxTag.cpp:

EbmlId KaxTagSubject_TheId               (0x29C1, 2);

The length, 7, is good as well.

I'll upload the file to
http://www.bunkus.org/videotools/mkvtoolnix/tagreading.mka

This problem seems to occur with a lot of tags, btw, not only with the
Subject.

-- 
 ==> Ciao, Mosu (Moritz Bunkus)
http://www.matroska.org



More information about the Matroska-devel mailing list