-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This file is part of libmatroska.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxTrackEntryData.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
- \author John Cannon <spyder2555 @ users.sf.net>\r
-*/\r
-#ifndef LIBMATROSKA_TRACK_ENTRY_DATA_H\r
-#define LIBMATROSKA_TRACK_ENTRY_DATA_H\r
-\r
-#include "matroska/KaxTypes.h"\r
-#include "ebml/EbmlUInteger.h"\r
-#include "ebml/EbmlFloat.h"\r
-#include "ebml/EbmlString.h"\r
-#include "ebml/EbmlUnicodeString.h"\r
-#include "ebml/EbmlBinary.h"\r
-#include "ebml/EbmlMaster.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-using namespace LIBEBML_NAMESPACE;\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackNumber)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackUID)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackType)\r
-};\r
-\r
-#if MATROSKA_VERSION >= 2\r
-DECLARE_MKX_UINTEGER(KaxTrackFlagEnabled)\r
-};\r
-#endif // MATROSKA_VERSION\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackFlagDefault)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackFlagForced)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackFlagLacing)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackMinCache)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackMaxCache)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackDefaultDuration)\r
-};\r
-\r
-DECLARE_MKX_FLOAT(KaxTrackTimecodeScale)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxMaxBlockAdditionID)\r
-};\r
-\r
-DECLARE_MKX_UNISTRING(KaxTrackName)\r
-};\r
-\r
-DECLARE_MKX_STRING(KaxTrackLanguage)\r
-};\r
-\r
-DECLARE_MKX_STRING(KaxCodecID)\r
-};\r
-\r
-DECLARE_MKX_BINARY(KaxCodecPrivate)\r
-};\r
-\r
-DECLARE_MKX_UNISTRING(KaxCodecName)\r
-};\r
-\r
-DECLARE_MKX_BINARY(KaxTrackAttachmentLink)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackOverlay)\r
-};\r
-\r
-DECLARE_MKX_MASTER(KaxTrackTranslate)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackTranslateCodec)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxTrackTranslateEditionUID)\r
-};\r
-\r
-DECLARE_MKX_BINARY(KaxTrackTranslateTrackID)\r
-};\r
-\r
-#if MATROSKA_VERSION >= 2\r
-DECLARE_MKX_UNISTRING(KaxCodecSettings)\r
-};\r
-\r
-DECLARE_MKX_STRING(KaxCodecInfoURL)\r
-};\r
-\r
-DECLARE_MKX_STRING(KaxCodecDownloadURL)\r
-};\r
-\r
-DECLARE_MKX_UINTEGER(KaxCodecDecodeAll)\r
-};\r
-#endif // MATROSKA_VERSION\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
-\r
-#endif // LIBMATROSKA_TRACK_ENTRY_DATA_H\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
+**
+** This file is part of libmatroska.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** This library is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public
+** License along with this library; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+**
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
+** Contact license@matroska.org if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+/*!
+ \file
+ \version \$Id: KaxTrackEntryData.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $
+ \author Steve Lhomme <robux4 @ users.sf.net>
+ \author John Cannon <spyder2555 @ users.sf.net>
+*/
+#ifndef LIBMATROSKA_TRACK_ENTRY_DATA_H
+#define LIBMATROSKA_TRACK_ENTRY_DATA_H
+
+#include "matroska/KaxTypes.h"
+#include "ebml/EbmlUInteger.h"
+#include "ebml/EbmlFloat.h"
+#include "ebml/EbmlString.h"
+#include "ebml/EbmlUnicodeString.h"
+#include "ebml/EbmlBinary.h"
+#include "ebml/EbmlMaster.h"
+#include "matroska/KaxDefines.h"
+
+using namespace LIBEBML_NAMESPACE;
+
+START_LIBMATROSKA_NAMESPACE
+
+DECLARE_MKX_UINTEGER(KaxTrackNumber)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackUID)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackType)
+};
+
+#if MATROSKA_VERSION >= 2
+DECLARE_MKX_UINTEGER(KaxTrackFlagEnabled)
+};
+#endif // MATROSKA_VERSION
+
+DECLARE_MKX_UINTEGER(KaxTrackFlagDefault)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackFlagForced)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackFlagLacing)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackMinCache)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackMaxCache)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackDefaultDuration)
+};
+
+DECLARE_MKX_FLOAT(KaxTrackTimecodeScale)
+};
+
+DECLARE_MKX_UINTEGER(KaxMaxBlockAdditionID)
+};
+
+DECLARE_MKX_UNISTRING(KaxTrackName)
+};
+
+DECLARE_MKX_STRING(KaxTrackLanguage)
+};
+
+DECLARE_MKX_STRING(KaxCodecID)
+};
+
+DECLARE_MKX_BINARY(KaxCodecPrivate)
+};
+
+DECLARE_MKX_UNISTRING(KaxCodecName)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackAttachmentLink)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackOverlay)
+};
+
+DECLARE_MKX_MASTER(KaxTrackTranslate)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackTranslateCodec)
+};
+
+DECLARE_MKX_UINTEGER(KaxTrackTranslateEditionUID)
+};
+
+DECLARE_MKX_BINARY(KaxTrackTranslateTrackID)
+};
+
+#if MATROSKA_VERSION >= 2
+DECLARE_MKX_UNISTRING(KaxCodecSettings)
+};
+
+DECLARE_MKX_STRING(KaxCodecInfoURL)
+};
+
+DECLARE_MKX_STRING(KaxCodecDownloadURL)
+};
+
+DECLARE_MKX_UINTEGER(KaxCodecDecodeAll)
+};
+#endif // MATROSKA_VERSION
+
+END_LIBMATROSKA_NAMESPACE
+
+#endif // LIBMATROSKA_TRACK_ENTRY_DATA_H
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This file is part of libmatroska.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxAttached.cpp 1202 2005-08-30 14:39:01Z robux4 $\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
-*/\r
-#include "matroska/KaxAttached.h"\r
-#include "matroska/KaxContexts.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-// sub elements\r
-\r
-using namespace LIBEBML_NAMESPACE;\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DEFINE_START_SEMANTIC(KaxAttached)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxFileName)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxMimeType)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxFileData)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxFileDescription)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxFileUID)\r
-#if MATROSKA_VERSION >= 2\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxFileReferral)\r
-#endif // MATROSKA_VERSION\r
-DEFINE_END_SEMANTIC(KaxAttached)\r
-\r
-DEFINE_MKX_MASTER_CONS(KaxAttached, 0x61A7, 2, KaxAttachments, "AttachedFile");\r
-DEFINE_MKX_UNISTRING (KaxFileDescription, 0x467E, 2, KaxAttachments, "FileDescription");\r
-DEFINE_MKX_UNISTRING (KaxFileName, 0x466E, 2, KaxAttachments, "FileName");\r
-DEFINE_MKX_STRING (KaxMimeType, 0x4660, 2, KaxAttachments, "FileMimeType");\r
-DEFINE_MKX_BINARY (KaxFileData, 0x465C, 2, KaxAttachments, "FileData");\r
-DEFINE_MKX_UINTEGER (KaxFileUID, 0x46AE, 2, KaxAttachments, "FileUID");\r
-#if MATROSKA_VERSION >= 2\r
-DEFINE_MKX_BINARY (KaxFileReferral, 0x4675, 2, KaxAttachments, "FileReferral");\r
-#endif\r
-\r
-KaxAttached::KaxAttached(EBML_EXTRA_DEF)\r
- :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxAttached) EBML_DEF_SEP EBML_EXTRA_CALL)\r
-{\r
- SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko)\r
-}\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
+**
+** This file is part of libmatroska.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** This library is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public
+** License along with this library; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+**
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
+** Contact license@matroska.org if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+/*!
+ \file
+ \version \$Id: KaxAttached.cpp 1202 2005-08-30 14:39:01Z robux4 $
+ \author Steve Lhomme <robux4 @ users.sf.net>
+*/
+#include "matroska/KaxAttached.h"
+#include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
+
+// sub elements
+
+using namespace LIBEBML_NAMESPACE;
+
+START_LIBMATROSKA_NAMESPACE
+
+DEFINE_START_SEMANTIC(KaxAttached)
+DEFINE_SEMANTIC_ITEM(true, true, KaxFileName)
+DEFINE_SEMANTIC_ITEM(true, true, KaxMimeType)
+DEFINE_SEMANTIC_ITEM(true, true, KaxFileData)
+DEFINE_SEMANTIC_ITEM(false, true, KaxFileDescription)
+DEFINE_SEMANTIC_ITEM(true, true, KaxFileUID)
+#if MATROSKA_VERSION >= 2
+DEFINE_SEMANTIC_ITEM(false, true, KaxFileReferral)
+#endif // MATROSKA_VERSION
+DEFINE_END_SEMANTIC(KaxAttached)
+
+DEFINE_MKX_MASTER_CONS(KaxAttached, 0x61A7, 2, KaxAttachments, "AttachedFile");
+DEFINE_MKX_UNISTRING (KaxFileDescription, 0x467E, 2, KaxAttached, "FileDescription");
+DEFINE_MKX_UNISTRING (KaxFileName, 0x466E, 2, KaxAttached, "FileName");
+DEFINE_MKX_STRING (KaxMimeType, 0x4660, 2, KaxAttached, "FileMimeType");
+DEFINE_MKX_BINARY (KaxFileData, 0x465C, 2, KaxAttached, "FileData");
+DEFINE_MKX_UINTEGER (KaxFileUID, 0x46AE, 2, KaxAttached, "FileUID");
+#if MATROSKA_VERSION >= 2
+DEFINE_MKX_BINARY (KaxFileReferral, 0x4675, 2, KaxAttached, "FileReferral");
+#endif
+
+KaxAttached::KaxAttached(EBML_EXTRA_DEF)
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxAttached) EBML_DEF_SEP EBML_EXTRA_CALL)
+{
+ SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko)
+}
+
+END_LIBMATROSKA_NAMESPACE
DEFINE_MKX_UINTEGER_DEF (KaxSliceLaceNumber, 0xCC, 1, KaxTimeSlice, "SliceLaceNumber", 0);
DEFINE_MKX_UINTEGER_DEF (KaxSliceFrameNumber, 0xCD, 1, KaxTimeSlice, "SliceFrameNumber", 0);
DEFINE_MKX_UINTEGER_DEF (KaxSliceBlockAddID, 0xCB, 1, KaxTimeSlice, "SliceBlockAddID", 0);
-DEFINE_MKX_UINTEGER (KaxSliceDelay, 0xCE, 1, KaxTimeSlice, "SliceDelay");
+DEFINE_MKX_UINTEGER_DEF (KaxSliceDelay, 0xCE, 1, KaxTimeSlice, "SliceDelay", 0);
DEFINE_MKX_UINTEGER_DEF (KaxSliceDuration, 0xCF, 1, KaxTimeSlice, "SliceDuration", 0);
#if MATROSKA_VERSION >= 2
DEFINE_MKX_SINTEGER (KaxReferenceVirtual, 0xFD, 1, KaxBlockGroup, "ReferenceVirtual");
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This file is part of libmatroska.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxChapters.cpp 1201 2005-08-30 14:28:27Z robux4 $\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
-*/\r
-#include "matroska/KaxChapters.h"\r
-#include "matroska/KaxContexts.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-// sub elements\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DEFINE_START_SEMANTIC(KaxChapters)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxEditionEntry)\r
-DEFINE_END_SEMANTIC(KaxChapters)\r
-\r
-DEFINE_START_SEMANTIC(KaxEditionEntry)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxEditionUID)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxEditionFlagHidden)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxEditionFlagDefault)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxEditionFlagOrdered)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxChapterAtom)\r
-DEFINE_END_SEMANTIC(KaxEditionEntry)\r
-\r
-DEFINE_START_SEMANTIC(KaxChapterAtom)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxChapterAtom)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterUID)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterTimeStart)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxChapterTimeEnd)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterFlagHidden)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterFlagEnabled)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxChapterSegmentUID)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxChapterSegmentEditionUID)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxChapterPhysicalEquiv)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxChapterTrack)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxChapterDisplay)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxChapterProcess)\r
-DEFINE_END_SEMANTIC(KaxChapterAtom)\r
-\r
-DEFINE_START_SEMANTIC(KaxChapterTrack)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxChapterTrackNumber)\r
-DEFINE_END_SEMANTIC(KaxChapterTrack)\r
-\r
-DEFINE_START_SEMANTIC(KaxChapterDisplay)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterString)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxChapterLanguage)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxChapterCountry)\r
-DEFINE_END_SEMANTIC(KaxChapterDisplay)\r
-\r
-DEFINE_START_SEMANTIC(KaxChapterProcess)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterProcessCodecID)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxChapterProcessPrivate)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxChapterProcessCommand)\r
-DEFINE_END_SEMANTIC(KaxChapterProcess)\r
-\r
-DEFINE_START_SEMANTIC(KaxChapterProcessCommand)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterProcessTime)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxChapterProcessData)\r
-DEFINE_END_SEMANTIC(KaxChapterProcessCommand)\r
-\r
-DEFINE_MKX_MASTER (KaxChapters, 0x1043A770, 4, KaxSegment, "Chapters");\r
-DEFINE_MKX_MASTER (KaxEditionEntry, 0x45B9, 2, KaxChapters, "EditionEntry");\r
-DEFINE_MKX_UINTEGER (KaxEditionUID, 0x45BC, 2, KaxEditionEntry, "EditionUID");\r
-DEFINE_MKX_UINTEGER_DEF(KaxEditionFlagHidden, 0x45BD, 2, KaxEditionEntry, "EditionFlagHidden", 0);\r
-DEFINE_MKX_UINTEGER_DEF(KaxEditionFlagDefault, 0x45DB, 2, KaxEditionEntry, "EditionFlagDefault", 0);\r
-DEFINE_MKX_UINTEGER_DEF(KaxEditionFlagOrdered, 0x45DD, 2, KaxEditionEntry, "EditionFlagOrdered", 0);\r
-DEFINE_MKX_MASTER (KaxChapterAtom, 0xB6, 1, KaxEditionEntry, "ChapterAtom");\r
-DEFINE_MKX_UINTEGER (KaxChapterUID, 0x73C4, 2, KaxChapterAtom, "ChapterUID");\r
-DEFINE_MKX_UINTEGER (KaxChapterTimeStart, 0x91, 1, KaxChapterAtom, "ChapterTimeStart");\r
-DEFINE_MKX_UINTEGER (KaxChapterTimeEnd, 0x92, 1, KaxChapterAtom, "ChapterTimeEnd");\r
-DEFINE_MKX_UINTEGER_DEF(KaxChapterFlagHidden, 0x98, 1, KaxChapterAtom, "ChapterFlagHidden", 0);\r
-DEFINE_MKX_UINTEGER_DEF(KaxChapterFlagEnabled, 0x4598, 2, KaxChapterAtom, "ChapterFlagEnabled", 1);\r
-DEFINE_MKX_BINARY (KaxChapterSegmentUID, 0x6E67, 2, KaxChapterAtom, "ChapterSegmentUID");\r
-DEFINE_MKX_BINARY (KaxChapterSegmentEditionUID, 0x6EBC, 2, KaxChapterAtom, "ChapterSegmentEditionUID");\r
-DEFINE_MKX_UINTEGER (KaxChapterPhysicalEquiv, 0x63C3, 2, KaxChapterAtom, "ChapterPhysicalEquiv");\r
-DEFINE_MKX_MASTER (KaxChapterTrack, 0x8F, 1, KaxChapterAtom, "ChapterTrack");\r
-DEFINE_MKX_UINTEGER (KaxChapterTrackNumber, 0x89, 1, KaxChapterTrack, "ChapterTrackNumber");\r
-DEFINE_MKX_MASTER (KaxChapterDisplay, 0x80, 1, KaxChapterAtom, "ChapterDisplay");\r
-DEFINE_MKX_UNISTRING (KaxChapterString, 0x85, 1, KaxChapterDisplay, "ChapterString");\r
-DEFINE_MKX_STRING_DEF (KaxChapterLanguage, 0x437C, 2, KaxChapterLanguage, "ChapterLanguage", "eng"); // parent context ?\r
-DEFINE_MKX_STRING (KaxChapterCountry, 0x437E, 2, KaxChapterCountry, "ChapterCountry"); // parent context ?\r
-DEFINE_MKX_MASTER (KaxChapterProcess, 0x6944, 2, KaxChapterAtom, "ChapterProcess");\r
-DEFINE_MKX_UINTEGER_DEF(KaxChapterProcessCodecID, 0x6955, 2, KaxChapterProcess, "ChapterProcessCodecID", 0);\r
-DEFINE_MKX_BINARY (KaxChapterProcessPrivate, 0x450D, 2, KaxChapterProcess, "ChapterProcessPrivate");\r
-DEFINE_MKX_MASTER (KaxChapterProcessCommand, 0x6911, 2, KaxChapterProcess, "ChapterProcessCommand");\r
-DEFINE_MKX_UINTEGER (KaxChapterProcessTime, 0x6922, 2, KaxChapterProcessCommand, "ChapterProcessTime");\r
-DEFINE_MKX_BINARY (KaxChapterProcessData, 0x6933, 2, KaxChapterProcessCommand, "ChapterProcessData");\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
+**
+** This file is part of libmatroska.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** This library is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public
+** License along with this library; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+**
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
+** Contact license@matroska.org if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+/*!
+ \file
+ \version \$Id: KaxChapters.cpp 1201 2005-08-30 14:28:27Z robux4 $
+ \author Steve Lhomme <robux4 @ users.sf.net>
+*/
+#include "matroska/KaxChapters.h"
+#include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
+
+// sub elements
+START_LIBMATROSKA_NAMESPACE
+
+DEFINE_START_SEMANTIC(KaxChapters)
+DEFINE_SEMANTIC_ITEM(true, false, KaxEditionEntry)
+DEFINE_END_SEMANTIC(KaxChapters)
+
+DEFINE_START_SEMANTIC(KaxEditionEntry)
+DEFINE_SEMANTIC_ITEM(false, true, KaxEditionUID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxEditionFlagHidden)
+DEFINE_SEMANTIC_ITEM(true, true, KaxEditionFlagDefault)
+DEFINE_SEMANTIC_ITEM(false, true, KaxEditionFlagOrdered)
+DEFINE_SEMANTIC_ITEM(true, false, KaxChapterAtom)
+DEFINE_END_SEMANTIC(KaxEditionEntry)
+
+DEFINE_START_SEMANTIC(KaxChapterAtom)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterAtom)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterUID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterTimeStart)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterTimeEnd)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterFlagHidden)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterFlagEnabled)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterSegmentUID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterSegmentEditionUID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterPhysicalEquiv)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterTrack)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterDisplay)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterProcess)
+DEFINE_END_SEMANTIC(KaxChapterAtom)
+
+DEFINE_START_SEMANTIC(KaxChapterTrack)
+DEFINE_SEMANTIC_ITEM(true, false, KaxChapterTrackNumber)
+DEFINE_END_SEMANTIC(KaxChapterTrack)
+
+DEFINE_START_SEMANTIC(KaxChapterDisplay)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterString)
+DEFINE_SEMANTIC_ITEM(true, false, KaxChapterLanguage)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterCountry)
+DEFINE_END_SEMANTIC(KaxChapterDisplay)
+
+DEFINE_START_SEMANTIC(KaxChapterProcess)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterProcessCodecID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterProcessPrivate)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterProcessCommand)
+DEFINE_END_SEMANTIC(KaxChapterProcess)
+
+DEFINE_START_SEMANTIC(KaxChapterProcessCommand)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterProcessTime)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterProcessData)
+DEFINE_END_SEMANTIC(KaxChapterProcessCommand)
+
+DEFINE_MKX_MASTER (KaxChapters, 0x1043A770, 4, KaxSegment, "Chapters");
+DEFINE_MKX_MASTER (KaxEditionEntry, 0x45B9, 2, KaxChapters, "EditionEntry");
+DEFINE_MKX_UINTEGER (KaxEditionUID, 0x45BC, 2, KaxEditionEntry, "EditionUID");
+DEFINE_MKX_UINTEGER_DEF(KaxEditionFlagHidden, 0x45BD, 2, KaxEditionEntry, "EditionFlagHidden", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxEditionFlagDefault, 0x45DB, 2, KaxEditionEntry, "EditionFlagDefault", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxEditionFlagOrdered, 0x45DD, 2, KaxEditionEntry, "EditionFlagOrdered", 0);
+DEFINE_MKX_MASTER (KaxChapterAtom, 0xB6, 1, KaxEditionEntry, "ChapterAtom");
+DEFINE_MKX_UINTEGER (KaxChapterUID, 0x73C4, 2, KaxChapterAtom, "ChapterUID");
+DEFINE_MKX_UINTEGER (KaxChapterTimeStart, 0x91, 1, KaxChapterAtom, "ChapterTimeStart");
+DEFINE_MKX_UINTEGER (KaxChapterTimeEnd, 0x92, 1, KaxChapterAtom, "ChapterTimeEnd");
+DEFINE_MKX_UINTEGER_DEF(KaxChapterFlagHidden, 0x98, 1, KaxChapterAtom, "ChapterFlagHidden", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxChapterFlagEnabled, 0x4598, 2, KaxChapterAtom, "ChapterFlagEnabled", 1);
+DEFINE_MKX_BINARY (KaxChapterSegmentUID, 0x6E67, 2, KaxChapterAtom, "ChapterSegmentUID");
+DEFINE_MKX_BINARY (KaxChapterSegmentEditionUID, 0x6EBC, 2, KaxChapterAtom, "ChapterSegmentEditionUID");
+DEFINE_MKX_UINTEGER (KaxChapterPhysicalEquiv, 0x63C3, 2, KaxChapterAtom, "ChapterPhysicalEquiv");
+DEFINE_MKX_MASTER (KaxChapterTrack, 0x8F, 1, KaxChapterAtom, "ChapterTrack");
+DEFINE_MKX_UINTEGER (KaxChapterTrackNumber, 0x89, 1, KaxChapterTrack, "ChapterTrackNumber");
+DEFINE_MKX_MASTER (KaxChapterDisplay, 0x80, 1, KaxChapterAtom, "ChapterDisplay");
+DEFINE_MKX_UNISTRING (KaxChapterString, 0x85, 1, KaxChapterDisplay, "ChapterString");
+DEFINE_MKX_STRING_DEF (KaxChapterLanguage, 0x437C, 2, KaxChapterDisplay, "ChapterLanguage", "eng"); // parent context ?
+DEFINE_MKX_STRING (KaxChapterCountry, 0x437E, 2, KaxChapterDisplay, "ChapterCountry"); // parent context ?
+DEFINE_MKX_MASTER (KaxChapterProcess, 0x6944, 2, KaxChapterAtom, "ChapterProcess");
+DEFINE_MKX_UINTEGER_DEF(KaxChapterProcessCodecID, 0x6955, 2, KaxChapterProcess, "ChapterProcessCodecID", 0);
+DEFINE_MKX_BINARY (KaxChapterProcessPrivate, 0x450D, 2, KaxChapterProcess, "ChapterProcessPrivate");
+DEFINE_MKX_MASTER (KaxChapterProcessCommand, 0x6911, 2, KaxChapterProcess, "ChapterProcessCommand");
+DEFINE_MKX_UINTEGER (KaxChapterProcessTime, 0x6922, 2, KaxChapterProcessCommand, "ChapterProcessTime");
+DEFINE_MKX_BINARY (KaxChapterProcessData, 0x6933, 2, KaxChapterProcessCommand, "ChapterProcessData");
+
+END_LIBMATROSKA_NAMESPACE
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This file is part of libmatroska.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxContentEncoding.cpp 640 2004-07-09 21:05:36Z mosu $\r
- \author Moritz Bunkus <moritz @ bunkus.org>\r
-*/\r
-#include "matroska/KaxContentEncoding.h"\r
-#include "matroska/KaxContexts.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DEFINE_START_SEMANTIC(KaxContentEncodings)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncoding)\r
-DEFINE_END_SEMANTIC(KaxContentEncodings)\r
-\r
-DEFINE_START_SEMANTIC(KaxContentEncoding)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncodingOrder)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncodingScope)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncodingType)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentCompression)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncryption)\r
-DEFINE_END_SEMANTIC(KaxContentEncoding)\r
-\r
-DEFINE_START_SEMANTIC(KaxContentCompression)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxContentCompAlgo)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentCompSettings)\r
-DEFINE_END_SEMANTIC(KaxContentCompression)\r
-\r
-DEFINE_START_SEMANTIC(KaxContentEncryption)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncAlgo)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncKeyID)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentSignature)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentSigKeyID)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentSigAlgo)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentSigHashAlgo)\r
-DEFINE_END_SEMANTIC(KaxContentEncryption)\r
-\r
-DEFINE_MKX_MASTER (KaxContentEncodings, 0x6d80, 2, KaxTrackEntry, "ContentEncodings");\r
-DEFINE_MKX_MASTER (KaxContentEncoding, 0x6240, 2, KaxContentEncodings, "ContentEncoding");\r
-DEFINE_MKX_UINTEGER_DEF(KaxContentEncodingOrder, 0x5031, 2, KaxContentEncoding, "ContentEncodingOrder", 0);\r
-DEFINE_MKX_UINTEGER_DEF(KaxContentEncodingScope, 0x5032, 2, KaxContentEncoding, "ContentEncodingScope", 1);\r
-DEFINE_MKX_UINTEGER_DEF(KaxContentEncodingType, 0x5033, 2, KaxContentEncoding, "ContentEncodingType", 0);\r
-DEFINE_MKX_MASTER (KaxContentCompression, 0x5034, 2, KaxContentEncoding, "ContentCompression");\r
-DEFINE_MKX_UINTEGER_DEF(KaxContentCompAlgo, 0x4254, 2, KaxContentCompression, "ContentCompAlgo", 0);\r
-DEFINE_MKX_BINARY (KaxContentCompSettings, 0x4255, 2, KaxContentCompression, "ContentCompSettings");\r
-DEFINE_MKX_MASTER (KaxContentEncryption, 0x5035, 2, KaxContentEncoding, "ContentEncryption");\r
-DEFINE_MKX_UINTEGER_DEF(KaxContentEncAlgo, 0x47e1, 2, KaxContentEncryption, "ContentEncAlgo", 0);\r
-DEFINE_MKX_BINARY (KaxContentEncKeyID, 0x47e2, 2, KaxContentEncryption, "ContentEncKeyID");\r
-DEFINE_MKX_BINARY (KaxContentSignature, 0x47e3, 2, KaxContentEncryption, "ContentSignature");\r
-DEFINE_MKX_BINARY (KaxContentSigKeyID, 0x47e4, 2, KaxContentEncryption, "ContentSigKeyID");\r
-DEFINE_MKX_UINTEGER_DEF(KaxContentSigAlgo, 0x47e5, 2, KaxContentEncryption, "ContentSigAlgo", 0);\r
-DEFINE_MKX_UINTEGER_DEF(KaxContentSigHashAlgo, 0x47e6, 2, KaxContentEncryption, "ContentSigHashAlgo", 0);\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
+**
+** This file is part of libmatroska.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** This library is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public
+** License along with this library; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+**
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
+** Contact license@matroska.org if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+/*!
+ \file
+ \version \$Id: KaxContentEncoding.cpp 640 2004-07-09 21:05:36Z mosu $
+ \author Moritz Bunkus <moritz @ bunkus.org>
+*/
+#include "matroska/KaxContentEncoding.h"
+#include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
+
+START_LIBMATROSKA_NAMESPACE
+
+DEFINE_START_SEMANTIC(KaxContentEncodings)
+DEFINE_SEMANTIC_ITEM(true, false, KaxContentEncoding)
+DEFINE_END_SEMANTIC(KaxContentEncodings)
+
+DEFINE_START_SEMANTIC(KaxContentEncoding)
+DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncodingOrder)
+DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncodingScope)
+DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncodingType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentCompression)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncryption)
+DEFINE_END_SEMANTIC(KaxContentEncoding)
+
+DEFINE_START_SEMANTIC(KaxContentCompression)
+DEFINE_SEMANTIC_ITEM(true, true, KaxContentCompAlgo)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentCompSettings)
+DEFINE_END_SEMANTIC(KaxContentCompression)
+
+DEFINE_START_SEMANTIC(KaxContentEncryption)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncAlgo)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncKeyID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentSignature)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentSigKeyID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentSigAlgo)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentSigHashAlgo)
+DEFINE_END_SEMANTIC(KaxContentEncryption)
+
+DEFINE_MKX_MASTER (KaxContentEncodings, 0x6d80, 2, KaxTrackEntry, "ContentEncodings");
+DEFINE_MKX_MASTER (KaxContentEncoding, 0x6240, 2, KaxContentEncodings, "ContentEncoding");
+DEFINE_MKX_UINTEGER_DEF(KaxContentEncodingOrder, 0x5031, 2, KaxContentEncoding, "ContentEncodingOrder", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxContentEncodingScope, 0x5032, 2, KaxContentEncoding, "ContentEncodingScope", 1);
+DEFINE_MKX_UINTEGER_DEF(KaxContentEncodingType, 0x5033, 2, KaxContentEncoding, "ContentEncodingType", 0);
+DEFINE_MKX_MASTER (KaxContentCompression, 0x5034, 2, KaxContentEncoding, "ContentCompression");
+DEFINE_MKX_UINTEGER_DEF(KaxContentCompAlgo, 0x4254, 2, KaxContentCompression, "ContentCompAlgo", 0);
+DEFINE_MKX_BINARY (KaxContentCompSettings, 0x4255, 2, KaxContentCompression, "ContentCompSettings");
+DEFINE_MKX_MASTER (KaxContentEncryption, 0x5035, 2, KaxContentEncoding, "ContentEncryption");
+DEFINE_MKX_UINTEGER_DEF(KaxContentEncAlgo, 0x47e1, 2, KaxContentEncryption, "ContentEncAlgo", 0);
+DEFINE_MKX_BINARY (KaxContentEncKeyID, 0x47e2, 2, KaxContentEncryption, "ContentEncKeyID");
+DEFINE_MKX_BINARY (KaxContentSignature, 0x47e3, 2, KaxContentEncryption, "ContentSignature");
+DEFINE_MKX_BINARY (KaxContentSigKeyID, 0x47e4, 2, KaxContentEncryption, "ContentSigKeyID");
+DEFINE_MKX_UINTEGER_DEF(KaxContentSigAlgo, 0x47e5, 2, KaxContentEncryption, "ContentSigAlgo", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxContentSigHashAlgo, 0x47e6, 2, KaxContentEncryption, "ContentSigHashAlgo", 0);
+
+END_LIBMATROSKA_NAMESPACE
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxCuesData.cpp 1265 2007-01-14 17:20:35Z mosu $\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
-*/\r
-#include <cassert>\r
-\r
-#include "matroska/KaxCuesData.h"\r
-#include "matroska/KaxContexts.h"\r
-#include "matroska/KaxBlock.h"\r
-#include "matroska/KaxBlockData.h"\r
-#include "matroska/KaxCluster.h"\r
-#include "matroska/KaxSegment.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DEFINE_START_SEMANTIC(KaxCuePoint)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxCueTime)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxCueTrackPositions)\r
-DEFINE_END_SEMANTIC(KaxCuePoint)\r
-\r
-DEFINE_START_SEMANTIC(KaxCueTrackPositions)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxCueTrack)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxCueClusterPosition)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxCueBlockNumber)\r
-#if MATROSKA_VERSION >= 2\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxCueCodecState)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxCueReference)\r
-#endif // MATROSKA_VERSION\r
-DEFINE_END_SEMANTIC(KaxCueTrackPositions)\r
-\r
-#if MATROSKA_VERSION >= 2\r
-DEFINE_START_SEMANTIC(KaxCueReference)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxCueRefTime)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxCueRefCluster)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxCueRefNumber)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxCueRefCodecState)\r
-DEFINE_END_SEMANTIC(KaxCueReference)\r
-#endif // MATROSKA_VERSION\r
-\r
-DEFINE_MKX_MASTER (KaxCuePoint, 0xBB, 1, KaxCues, "CuePoint");\r
-DEFINE_MKX_UINTEGER (KaxCueTime, 0xB3, 1, KaxCuePoint, "CueTime");\r
-DEFINE_MKX_MASTER (KaxCueTrackPositions, 0xB7, 1, KaxCuePoint, "CueTrackPositions");\r
-DEFINE_MKX_UINTEGER (KaxCueTrack, 0xF7, 1, KaxCueTrackPositions, "CueTrack");\r
-DEFINE_MKX_UINTEGER (KaxCueClusterPosition, 0xF1, 1, KaxCueTrackPositions, "CueClusterPosition");\r
-DEFINE_MKX_UINTEGER_DEF(KaxCueBlockNumber, 0x5378, 2, KaxCueTrackPositions, "CueBlockNumber", 1);\r
-#if MATROSKA_VERSION >= 2\r
-DEFINE_MKX_UINTEGER_DEF(KaxCueCodecState, 0xEA, 1, KaxCueTrackPositions, "CueCodecState", 0);\r
-DEFINE_MKX_MASTER (KaxCueReference, 0xDB, 1, KaxCueTrackPositions, "CueReference");\r
-DEFINE_MKX_UINTEGER (KaxCueRefTime, 0x96, 1, KaxCueReference, "CueRefTime");\r
-DEFINE_MKX_UINTEGER (KaxCueRefCluster, 0x97, 1, KaxCueRefTime, "CueRefCluster");\r
-DEFINE_MKX_UINTEGER_DEF(KaxCueRefNumber, 0x535F, 2, KaxCueRefTime, "CueRefNumber", 1);\r
-DEFINE_MKX_UINTEGER_DEF(KaxCueRefCodecState, 0xEB, 1, KaxCueRefTime, "CueRefCodecState", 0);\r
-#endif\r
-\r
-/*!\r
- \todo handle codec state checking\r
- \todo remove duplicate references (reference to 2 frames that each reference the same frame)\r
-*/\r
-void KaxCuePoint::PositionSet(const KaxBlockGroup & BlockReference, uint64 GlobalTimecodeScale)\r
-{\r
- // fill me\r
- KaxCueTime & NewTime = GetChild<KaxCueTime>(*this);\r
- *static_cast<EbmlUInteger*>(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale;\r
-\r
- KaxCueTrackPositions & NewPositions = AddNewChild<KaxCueTrackPositions>(*this);\r
- KaxCueTrack & TheTrack = GetChild<KaxCueTrack>(NewPositions);\r
- *static_cast<EbmlUInteger*>(&TheTrack) = BlockReference.TrackNumber();\r
- \r
- KaxCueClusterPosition & TheClustPos = GetChild<KaxCueClusterPosition>(NewPositions);\r
- *static_cast<EbmlUInteger*>(&TheClustPos) = BlockReference.ClusterPosition();\r
-\r
-#if MATROSKA_VERSION >= 2\r
- // handle reference use\r
- if (BlockReference.ReferenceCount() != 0)\r
- {\r
- unsigned int i;\r
- for (i=0; i<BlockReference.ReferenceCount(); i++) {\r
- KaxCueReference & NewRefs = AddNewChild<KaxCueReference>(NewPositions);\r
- NewRefs.AddReference(BlockReference.Reference(i).RefBlock(), GlobalTimecodeScale);\r
- }\r
- }\r
-\r
- KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockReference.FindFirstElt(EBML_INFO(KaxCodecState)));\r
- if (CodecState != NULL) {\r
- KaxCueCodecState &CueCodecState = AddNewChild<KaxCueCodecState>(NewPositions);\r
- *static_cast<EbmlUInteger*>(&CueCodecState) = BlockReference.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition());\r
- }\r
-#endif // MATROSKA_VERSION\r
-\r
- SetValueIsSet();\r
-}\r
-\r
-void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalTimecodeScale)\r
-{\r
- const KaxInternalBlock &BlockReference = BlobReference;\r
-\r
- // fill me\r
- KaxCueTime & NewTime = GetChild<KaxCueTime>(*this);\r
- *static_cast<EbmlUInteger*>(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale;\r
-\r
- KaxCueTrackPositions & NewPositions = AddNewChild<KaxCueTrackPositions>(*this);\r
- KaxCueTrack & TheTrack = GetChild<KaxCueTrack>(NewPositions);\r
- *static_cast<EbmlUInteger*>(&TheTrack) = BlockReference.TrackNum();\r
- \r
- KaxCueClusterPosition & TheClustPos = GetChild<KaxCueClusterPosition>(NewPositions);\r
- *static_cast<EbmlUInteger*>(&TheClustPos) = BlockReference.ClusterPosition();\r
-\r
-#if 0 // MATROSKA_VERSION >= 2\r
- // handle reference use\r
- if (BlockReference.ReferenceCount() != 0)\r
- {\r
- unsigned int i;\r
- for (i=0; i<BlockReference.ReferenceCount(); i++) {\r
- KaxCueReference & NewRefs = AddNewChild<KaxCueReference>(NewPositions);\r
- NewRefs.AddReference(BlockReference.Reference(i).RefBlock(), GlobalTimecodeScale);\r
- }\r
- }\r
-#endif // MATROSKA_VERSION\r
-\r
-#if MATROSKA_VERSION >= 2\r
- if (!BlobReference.IsSimpleBlock()) {\r
- const KaxBlockGroup &BlockGroup = BlobReference;\r
- const KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockGroup.FindFirstElt(EBML_INFO(KaxCodecState)));\r
- if (CodecState != NULL) {\r
- KaxCueCodecState &CueCodecState = AddNewChild<KaxCueCodecState>(NewPositions);\r
- *static_cast<EbmlUInteger*>(&CueCodecState) = BlockGroup.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition());\r
- }\r
- }\r
-#endif // MATROSKA_VERSION\r
-\r
- SetValueIsSet();\r
-}\r
-\r
-#if MATROSKA_VERSION >= 2\r
-/*!\r
- \todo handle codec state checking\r
-*/\r
-void KaxCueReference::AddReference(const KaxBlockBlob & BlockReference, uint64 GlobalTimecodeScale)\r
-{\r
- const KaxInternalBlock & theBlock = BlockReference;\r
- KaxCueRefTime & NewTime = GetChild<KaxCueRefTime>(*this);\r
- *static_cast<EbmlUInteger*>(&NewTime) = theBlock.GlobalTimecode() / GlobalTimecodeScale;\r
-\r
- KaxCueRefCluster & TheClustPos = GetChild<KaxCueRefCluster>(*this);\r
- *static_cast<EbmlUInteger*>(&TheClustPos) = theBlock.ClusterPosition();\r
-\r
-#ifdef OLD\r
- // handle recursive reference use\r
- if (BlockReference.ReferenceCount() != 0)\r
- {\r
- unsigned int i;\r
- for (i=0; i<BlockReference.ReferenceCount(); i++) {\r
- AddReference(BlockReference.Reference(i).RefBlock());\r
- }\r
- }\r
-#endif /* OLD */\r
-}\r
-#endif\r
-\r
-bool KaxCuePoint::IsSmallerThan(const EbmlElement * EltB) const\r
-{\r
- assert(EbmlId(*this) == EBML_ID(KaxCuePoint));\r
- assert(EbmlId(*EltB) == EBML_ID(KaxCuePoint));\r
-\r
- const KaxCuePoint & theEltB = *static_cast<const KaxCuePoint *>(EltB);\r
-\r
- // compare timecode\r
- const KaxCueTime * TimeCodeA = static_cast<const KaxCueTime *>(FindElt(EBML_INFO(KaxCueTime)));\r
- if (TimeCodeA == NULL)\r
- return false;\r
-\r
- const KaxCueTime * TimeCodeB = static_cast<const KaxCueTime *>(theEltB.FindElt(EBML_INFO(KaxCueTime)));\r
- if (TimeCodeB == NULL)\r
- return false;\r
-\r
- if (TimeCodeA->IsSmallerThan(TimeCodeB))\r
- return true;\r
-\r
- if (TimeCodeB->IsSmallerThan(TimeCodeA))\r
- return false;\r
-\r
- // compare tracks (timecodes are equal)\r
- const KaxCueTrack * TrackA = static_cast<const KaxCueTrack *>(FindElt(EBML_INFO(KaxCueTrack)));\r
- if (TrackA == NULL)\r
- return false;\r
-\r
- const KaxCueTrack * TrackB = static_cast<const KaxCueTrack *>(theEltB.FindElt(EBML_INFO(KaxCueTrack)));\r
- if (TrackB == NULL)\r
- return false;\r
-\r
- if (TrackA->IsSmallerThan(TrackB))\r
- return true;\r
-\r
- if (TrackB->IsSmallerThan(TrackA))\r
- return false;\r
-\r
- return false;\r
-}\r
-\r
-bool KaxCuePoint::Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const\r
-{\r
- const KaxCueTime *aTime = static_cast<const KaxCueTime *>(FindFirstElt(EBML_INFO(KaxCueTime)));\r
- if (aTime == NULL)\r
- return false;\r
- aTimecode = uint64(*aTime) * GlobalTimecodeScale;\r
- return true;\r
-}\r
-\r
-/*!\r
- \brief return the position of the Cluster to load\r
-*/\r
-const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const\r
-{\r
- const KaxCueTrackPositions * result = NULL;\r
- uint64 aPosition = EBML_PRETTYLONGINT(0xFFFFFFFFFFFFFFF);\r
- // find the position of the "earlier" Cluster\r
- const KaxCueTrackPositions *aPoss = static_cast<const KaxCueTrackPositions *>(FindFirstElt(EBML_INFO(KaxCueTrackPositions)));\r
- while (aPoss != NULL)\r
- {\r
- const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(aPoss->FindFirstElt(EBML_INFO(KaxCueClusterPosition)));\r
- if (aPos != NULL && uint64(*aPos) < aPosition) {\r
- aPosition = uint64(*aPos);\r
- result = aPoss;\r
- }\r
- \r
- aPoss = static_cast<const KaxCueTrackPositions *>(FindNextElt(*aPoss));\r
- }\r
- return result;\r
-}\r
-\r
-uint64 KaxCueTrackPositions::ClusterPosition() const\r
-{\r
- const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(FindFirstElt(EBML_INFO(KaxCueClusterPosition)));\r
- if (aPos == NULL)\r
- return 0;\r
-\r
- return uint64(*aPos);\r
-}\r
-\r
-uint16 KaxCueTrackPositions::TrackNumber() const\r
-{\r
- const KaxCueTrack *aTrack = static_cast<const KaxCueTrack *>(FindFirstElt(EBML_INFO(KaxCueTrack)));\r
- if (aTrack == NULL)\r
- return 0;\r
-\r
- return uint16(*aTrack);\r
-}\r
-\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** This library is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public
+** License along with this library; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+**
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
+** Contact license@matroska.org if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+/*!
+ \file
+ \version \$Id: KaxCuesData.cpp 1265 2007-01-14 17:20:35Z mosu $
+ \author Steve Lhomme <robux4 @ users.sf.net>
+*/
+#include <cassert>
+
+#include "matroska/KaxCuesData.h"
+#include "matroska/KaxContexts.h"
+#include "matroska/KaxBlock.h"
+#include "matroska/KaxBlockData.h"
+#include "matroska/KaxCluster.h"
+#include "matroska/KaxSegment.h"
+#include "matroska/KaxDefines.h"
+
+START_LIBMATROSKA_NAMESPACE
+
+DEFINE_START_SEMANTIC(KaxCuePoint)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueTime)
+DEFINE_SEMANTIC_ITEM(true, false, KaxCueTrackPositions)
+DEFINE_END_SEMANTIC(KaxCuePoint)
+
+DEFINE_START_SEMANTIC(KaxCueTrackPositions)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueTrack)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueClusterPosition)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCueBlockNumber)
+#if MATROSKA_VERSION >= 2
+DEFINE_SEMANTIC_ITEM(false, true, KaxCueCodecState)
+DEFINE_SEMANTIC_ITEM(false, false, KaxCueReference)
+#endif // MATROSKA_VERSION
+DEFINE_END_SEMANTIC(KaxCueTrackPositions)
+
+#if MATROSKA_VERSION >= 2
+DEFINE_START_SEMANTIC(KaxCueReference)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueRefTime)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueRefCluster)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCueRefNumber)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCueRefCodecState)
+DEFINE_END_SEMANTIC(KaxCueReference)
+#endif // MATROSKA_VERSION
+
+DEFINE_MKX_MASTER (KaxCuePoint, 0xBB, 1, KaxCues, "CuePoint");
+DEFINE_MKX_UINTEGER (KaxCueTime, 0xB3, 1, KaxCuePoint, "CueTime");
+DEFINE_MKX_MASTER (KaxCueTrackPositions, 0xB7, 1, KaxCuePoint, "CueTrackPositions");
+DEFINE_MKX_UINTEGER (KaxCueTrack, 0xF7, 1, KaxCueTrackPositions, "CueTrack");
+DEFINE_MKX_UINTEGER (KaxCueClusterPosition, 0xF1, 1, KaxCueTrackPositions, "CueClusterPosition");
+DEFINE_MKX_UINTEGER_DEF(KaxCueBlockNumber, 0x5378, 2, KaxCueTrackPositions, "CueBlockNumber", 1);
+#if MATROSKA_VERSION >= 2
+DEFINE_MKX_UINTEGER_DEF(KaxCueCodecState, 0xEA, 1, KaxCueTrackPositions, "CueCodecState", 0);
+DEFINE_MKX_MASTER (KaxCueReference, 0xDB, 1, KaxCueTrackPositions, "CueReference");
+DEFINE_MKX_UINTEGER (KaxCueRefTime, 0x96, 1, KaxCueReference, "CueRefTime");
+DEFINE_MKX_UINTEGER (KaxCueRefCluster, 0x97, 1, KaxCueReference, "CueRefCluster");
+DEFINE_MKX_UINTEGER_DEF(KaxCueRefNumber, 0x535F, 2, KaxCueReference, "CueRefNumber", 1);
+DEFINE_MKX_UINTEGER_DEF(KaxCueRefCodecState, 0xEB, 1, KaxCueReference, "CueRefCodecState", 0);
+#endif
+
+/*!
+ \todo handle codec state checking
+ \todo remove duplicate references (reference to 2 frames that each reference the same frame)
+*/
+void KaxCuePoint::PositionSet(const KaxBlockGroup & BlockReference, uint64 GlobalTimecodeScale)
+{
+ // fill me
+ KaxCueTime & NewTime = GetChild<KaxCueTime>(*this);
+ *static_cast<EbmlUInteger*>(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale;
+
+ KaxCueTrackPositions & NewPositions = AddNewChild<KaxCueTrackPositions>(*this);
+ KaxCueTrack & TheTrack = GetChild<KaxCueTrack>(NewPositions);
+ *static_cast<EbmlUInteger*>(&TheTrack) = BlockReference.TrackNumber();
+
+ KaxCueClusterPosition & TheClustPos = GetChild<KaxCueClusterPosition>(NewPositions);
+ *static_cast<EbmlUInteger*>(&TheClustPos) = BlockReference.ClusterPosition();
+
+#if MATROSKA_VERSION >= 2
+ // handle reference use
+ if (BlockReference.ReferenceCount() != 0)
+ {
+ unsigned int i;
+ for (i=0; i<BlockReference.ReferenceCount(); i++) {
+ KaxCueReference & NewRefs = AddNewChild<KaxCueReference>(NewPositions);
+ NewRefs.AddReference(BlockReference.Reference(i).RefBlock(), GlobalTimecodeScale);
+ }
+ }
+
+ KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockReference.FindFirstElt(EBML_INFO(KaxCodecState)));
+ if (CodecState != NULL) {
+ KaxCueCodecState &CueCodecState = AddNewChild<KaxCueCodecState>(NewPositions);
+ *static_cast<EbmlUInteger*>(&CueCodecState) = BlockReference.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition());
+ }
+#endif // MATROSKA_VERSION
+
+ SetValueIsSet();
+}
+
+void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalTimecodeScale)
+{
+ const KaxInternalBlock &BlockReference = BlobReference;
+
+ // fill me
+ KaxCueTime & NewTime = GetChild<KaxCueTime>(*this);
+ *static_cast<EbmlUInteger*>(&NewTime) = BlockReference.GlobalTimecode() / GlobalTimecodeScale;
+
+ KaxCueTrackPositions & NewPositions = AddNewChild<KaxCueTrackPositions>(*this);
+ KaxCueTrack & TheTrack = GetChild<KaxCueTrack>(NewPositions);
+ *static_cast<EbmlUInteger*>(&TheTrack) = BlockReference.TrackNum();
+
+ KaxCueClusterPosition & TheClustPos = GetChild<KaxCueClusterPosition>(NewPositions);
+ *static_cast<EbmlUInteger*>(&TheClustPos) = BlockReference.ClusterPosition();
+
+#if 0 // MATROSKA_VERSION >= 2
+ // handle reference use
+ if (BlockReference.ReferenceCount() != 0)
+ {
+ unsigned int i;
+ for (i=0; i<BlockReference.ReferenceCount(); i++) {
+ KaxCueReference & NewRefs = AddNewChild<KaxCueReference>(NewPositions);
+ NewRefs.AddReference(BlockReference.Reference(i).RefBlock(), GlobalTimecodeScale);
+ }
+ }
+#endif // MATROSKA_VERSION
+
+#if MATROSKA_VERSION >= 2
+ if (!BlobReference.IsSimpleBlock()) {
+ const KaxBlockGroup &BlockGroup = BlobReference;
+ const KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockGroup.FindFirstElt(EBML_INFO(KaxCodecState)));
+ if (CodecState != NULL) {
+ KaxCueCodecState &CueCodecState = AddNewChild<KaxCueCodecState>(NewPositions);
+ *static_cast<EbmlUInteger*>(&CueCodecState) = BlockGroup.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition());
+ }
+ }
+#endif // MATROSKA_VERSION
+
+ SetValueIsSet();
+}
+
+#if MATROSKA_VERSION >= 2
+/*!
+ \todo handle codec state checking
+*/
+void KaxCueReference::AddReference(const KaxBlockBlob & BlockReference, uint64 GlobalTimecodeScale)
+{
+ const KaxInternalBlock & theBlock = BlockReference;
+ KaxCueRefTime & NewTime = GetChild<KaxCueRefTime>(*this);
+ *static_cast<EbmlUInteger*>(&NewTime) = theBlock.GlobalTimecode() / GlobalTimecodeScale;
+
+ KaxCueRefCluster & TheClustPos = GetChild<KaxCueRefCluster>(*this);
+ *static_cast<EbmlUInteger*>(&TheClustPos) = theBlock.ClusterPosition();
+
+#ifdef OLD
+ // handle recursive reference use
+ if (BlockReference.ReferenceCount() != 0)
+ {
+ unsigned int i;
+ for (i=0; i<BlockReference.ReferenceCount(); i++) {
+ AddReference(BlockReference.Reference(i).RefBlock());
+ }
+ }
+#endif /* OLD */
+}
+#endif
+
+bool KaxCuePoint::IsSmallerThan(const EbmlElement * EltB) const
+{
+ assert(EbmlId(*this) == EBML_ID(KaxCuePoint));
+ assert(EbmlId(*EltB) == EBML_ID(KaxCuePoint));
+
+ const KaxCuePoint & theEltB = *static_cast<const KaxCuePoint *>(EltB);
+
+ // compare timecode
+ const KaxCueTime * TimeCodeA = static_cast<const KaxCueTime *>(FindElt(EBML_INFO(KaxCueTime)));
+ if (TimeCodeA == NULL)
+ return false;
+
+ const KaxCueTime * TimeCodeB = static_cast<const KaxCueTime *>(theEltB.FindElt(EBML_INFO(KaxCueTime)));
+ if (TimeCodeB == NULL)
+ return false;
+
+ if (TimeCodeA->IsSmallerThan(TimeCodeB))
+ return true;
+
+ if (TimeCodeB->IsSmallerThan(TimeCodeA))
+ return false;
+
+ // compare tracks (timecodes are equal)
+ const KaxCueTrack * TrackA = static_cast<const KaxCueTrack *>(FindElt(EBML_INFO(KaxCueTrack)));
+ if (TrackA == NULL)
+ return false;
+
+ const KaxCueTrack * TrackB = static_cast<const KaxCueTrack *>(theEltB.FindElt(EBML_INFO(KaxCueTrack)));
+ if (TrackB == NULL)
+ return false;
+
+ if (TrackA->IsSmallerThan(TrackB))
+ return true;
+
+ if (TrackB->IsSmallerThan(TrackA))
+ return false;
+
+ return false;
+}
+
+bool KaxCuePoint::Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const
+{
+ const KaxCueTime *aTime = static_cast<const KaxCueTime *>(FindFirstElt(EBML_INFO(KaxCueTime)));
+ if (aTime == NULL)
+ return false;
+ aTimecode = uint64(*aTime) * GlobalTimecodeScale;
+ return true;
+}
+
+/*!
+ \brief return the position of the Cluster to load
+*/
+const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const
+{
+ const KaxCueTrackPositions * result = NULL;
+ uint64 aPosition = EBML_PRETTYLONGINT(0xFFFFFFFFFFFFFFF);
+ // find the position of the "earlier" Cluster
+ const KaxCueTrackPositions *aPoss = static_cast<const KaxCueTrackPositions *>(FindFirstElt(EBML_INFO(KaxCueTrackPositions)));
+ while (aPoss != NULL)
+ {
+ const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(aPoss->FindFirstElt(EBML_INFO(KaxCueClusterPosition)));
+ if (aPos != NULL && uint64(*aPos) < aPosition) {
+ aPosition = uint64(*aPos);
+ result = aPoss;
+ }
+
+ aPoss = static_cast<const KaxCueTrackPositions *>(FindNextElt(*aPoss));
+ }
+ return result;
+}
+
+uint64 KaxCueTrackPositions::ClusterPosition() const
+{
+ const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(FindFirstElt(EBML_INFO(KaxCueClusterPosition)));
+ if (aPos == NULL)
+ return 0;
+
+ return uint64(*aPos);
+}
+
+uint16 KaxCueTrackPositions::TrackNumber() const
+{
+ const KaxCueTrack *aTrack = static_cast<const KaxCueTrack *>(FindFirstElt(EBML_INFO(KaxCueTrack)));
+ if (aTrack == NULL)
+ return 0;
+
+ return uint16(*aTrack);
+}
+
+
+END_LIBMATROSKA_NAMESPACE
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This file is part of libmatroska.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxSegment.cpp 1096 2005-03-17 09:14:52Z robux4 $\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
-*/\r
-#include "matroska/KaxSegment.h"\r
-#include "ebml/EbmlHead.h"\r
-\r
-// sub elements\r
-#include "matroska/KaxCluster.h"\r
-#include "matroska/KaxSeekHead.h"\r
-#include "matroska/KaxCues.h"\r
-#include "matroska/KaxTracks.h"\r
-#include "matroska/KaxInfo.h"\r
-#include "matroska/KaxChapters.h"\r
-#include "matroska/KaxAttachments.h"\r
-#include "matroska/KaxTags.h"\r
-#include "matroska/KaxContexts.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DEFINE_START_SEMANTIC(KaxMatroska)\r
-DEFINE_SEMANTIC_ITEM(true, true, EbmlHead)\r
-DEFINE_SEMANTIC_ITEM(true, false, KaxSegment)\r
-DEFINE_END_SEMANTIC(KaxMatroska)\r
-\r
-DEFINE_START_SEMANTIC(KaxSegment)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxCluster)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxSeekHead)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxCues)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTracks)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxInfo)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxChapters)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxAttachments)\r
-DEFINE_SEMANTIC_ITEM(false, true, KaxTags)\r
-DEFINE_END_SEMANTIC(KaxSegment)\r
-\r
-DEFINE_MKX_CONTEXT(KaxMatroska);\r
-\r
-DEFINE_MKX_MASTER_ORPHAN(KaxSegment, 0x18538067, 4, "Segment\0rotomopogo");\r
-\r
-KaxSegment::KaxSegment(EBML_EXTRA_DEF)\r
- :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxSegment) EBML_DEF_SEP EBML_EXTRA_CALL)\r
-{\r
- SetSizeLength(5); // mandatory min size support (for easier updating) (2^(7*5)-2 = 32Go)\r
- SetSizeInfinite(); // by default a segment is big and the size is unknown in advance\r
-}\r
-\r
-KaxSegment::KaxSegment(const KaxSegment & ElementToClone)\r
- :EbmlMaster(ElementToClone)\r
-{\r
- // update the parent of each children\r
- EBML_MASTER_ITERATOR Itr = begin();\r
- while (Itr != end())\r
- {\r
- if (EbmlId(**Itr) == EBML_ID(KaxCluster)) {\r
- static_cast<KaxCluster *>(*Itr)->SetParent(*this);\r
- }\r
- ++Itr;\r
- }\r
-}\r
-\r
-\r
-uint64 KaxSegment::GetRelativePosition(uint64 aGlobalPosition) const\r
-{\r
- return aGlobalPosition - GetElementPosition() - HeadSize();\r
-}\r
-\r
-uint64 KaxSegment::GetRelativePosition(const EbmlElement & Elt) const\r
-{\r
- return GetRelativePosition(Elt.GetElementPosition());\r
-}\r
-\r
-uint64 KaxSegment::GetGlobalPosition(uint64 aRelativePosition) const\r
-{\r
- return aRelativePosition + GetElementPosition() + HeadSize();\r
-}\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
+**
+** This file is part of libmatroska.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** This library is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public
+** License along with this library; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+**
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
+** Contact license@matroska.org if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+/*!
+ \file
+ \version \$Id: KaxSegment.cpp 1096 2005-03-17 09:14:52Z robux4 $
+ \author Steve Lhomme <robux4 @ users.sf.net>
+*/
+#include "matroska/KaxSegment.h"
+#include "ebml/EbmlHead.h"
+
+// sub elements
+#include "matroska/KaxCluster.h"
+#include "matroska/KaxSeekHead.h"
+#include "matroska/KaxCues.h"
+#include "matroska/KaxTracks.h"
+#include "matroska/KaxInfo.h"
+#include "matroska/KaxChapters.h"
+#include "matroska/KaxAttachments.h"
+#include "matroska/KaxTags.h"
+#include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
+
+START_LIBMATROSKA_NAMESPACE
+
+DEFINE_START_SEMANTIC(KaxMatroska)
+DEFINE_SEMANTIC_ITEM(true, true, EbmlHead)
+DEFINE_SEMANTIC_ITEM(true, false, KaxSegment)
+DEFINE_END_SEMANTIC(KaxMatroska)
+
+DEFINE_START_SEMANTIC(KaxSegment)
+DEFINE_SEMANTIC_ITEM(false, false, KaxCluster)
+DEFINE_SEMANTIC_ITEM(false, false, KaxSeekHead)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCues)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTracks)
+DEFINE_SEMANTIC_ITEM(true, false, KaxInfo)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapters)
+DEFINE_SEMANTIC_ITEM(false, true, KaxAttachments)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTags)
+DEFINE_END_SEMANTIC(KaxSegment)
+
+DEFINE_MKX_CONTEXT(KaxMatroska);
+
+DEFINE_MKX_MASTER_ORPHAN(KaxSegment, 0x18538067, 4, "Segment\0rotomopogo");
+
+KaxSegment::KaxSegment(EBML_EXTRA_DEF)
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxSegment) EBML_DEF_SEP EBML_EXTRA_CALL)
+{
+ SetSizeLength(5); // mandatory min size support (for easier updating) (2^(7*5)-2 = 32Go)
+ SetSizeInfinite(); // by default a segment is big and the size is unknown in advance
+}
+
+KaxSegment::KaxSegment(const KaxSegment & ElementToClone)
+ :EbmlMaster(ElementToClone)
+{
+ // update the parent of each children
+ EBML_MASTER_ITERATOR Itr = begin();
+ while (Itr != end())
+ {
+ if (EbmlId(**Itr) == EBML_ID(KaxCluster)) {
+ static_cast<KaxCluster *>(*Itr)->SetParent(*this);
+ }
+ ++Itr;
+ }
+}
+
+
+uint64 KaxSegment::GetRelativePosition(uint64 aGlobalPosition) const
+{
+ return aGlobalPosition - GetElementPosition() - HeadSize();
+}
+
+uint64 KaxSegment::GetRelativePosition(const EbmlElement & Elt) const
+{
+ return GetRelativePosition(Elt.GetElementPosition());
+}
+
+uint64 KaxSegment::GetGlobalPosition(uint64 aRelativePosition) const
+{
+ return aRelativePosition + GetElementPosition() + HeadSize();
+}
+
+END_LIBMATROSKA_NAMESPACE
-/****************************************************************************\r
-** libmatroska : parse Matroska files, see http://www.matroska.org/\r
-**\r
-** <file/class description>\r
-**\r
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
-**\r
-** This file is part of libmatroska.\r
-**\r
-** This library is free software; you can redistribute it and/or\r
-** modify it under the terms of the GNU Lesser General Public\r
-** License as published by the Free Software Foundation; either\r
-** version 2.1 of the License, or (at your option) any later version.\r
-** \r
-** This library is distributed in the hope that it will be useful,\r
-** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-** Lesser General Public License for more details.\r
-** \r
-** You should have received a copy of the GNU Lesser General Public\r
-** License along with this library; if not, write to the Free Software\r
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-**\r
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
-** Contact license@matroska.org if any conditions of this licensing are\r
-** not clear to you.\r
-**\r
-**********************************************************************/\r
-\r
-/*!\r
- \file\r
- \version \$Id: KaxTrackEntryData.cpp 1201 2005-08-30 14:28:27Z robux4 $\r
- \author Steve Lhomme <robux4 @ users.sf.net>\r
- \author John Cannon <spyder2555 @ users.sf.net>\r
-*/\r
-#include "matroska/KaxTrackEntryData.h"\r
-#include "matroska/KaxContexts.h"\r
-#include "matroska/KaxDefines.h"\r
-\r
-START_LIBMATROSKA_NAMESPACE\r
-\r
-DEFINE_START_SEMANTIC(KaxTrackTranslate)\r
-DEFINE_SEMANTIC_ITEM(false, false, KaxTrackTranslateEditionUID)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTranslateCodec)\r
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTranslateTrackID)\r
-DEFINE_END_SEMANTIC(KaxTrackTranslate)\r
-\r
-DEFINE_MKX_UINTEGER (KaxTrackNumber, 0xD7, 1, KaxTracks, "TrackNumber");\r
-DEFINE_MKX_UINTEGER (KaxTrackUID, 0x73C5, 2, KaxTracks, "TrackUID");\r
-DEFINE_MKX_UINTEGER (KaxTrackType, 0x83, 1, KaxTracks, "TrackType");\r
-DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagDefault, 0x88, 1, KaxTracks, "TrackFlagEnabled", 1);\r
-DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagForced, 0x55AA, 2, KaxTracks, "TrackFlagForced", 0);\r
-DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagLacing, 0x9C, 1, KaxTracks, "TrackFlagLacing", 1);\r
-DEFINE_MKX_UINTEGER_DEF(KaxTrackMinCache, 0x6DE7, 2, KaxTracks, "TrackMinCache", 0);\r
-DEFINE_MKX_UINTEGER (KaxTrackMaxCache, 0x6DF8, 2, KaxTracks, "TrackMaxCache\0rotomodobopo");\r
-DEFINE_MKX_UINTEGER (KaxTrackDefaultDuration, 0x23E383, 3, KaxTracks, "TrackDefaultDuration");\r
-DEFINE_MKX_FLOAT_DEF (KaxTrackTimecodeScale, 0x23314F, 3, KaxTracks, "TrackTimecodeScale", 1.0);\r
-DEFINE_MKX_UINTEGER_DEF(KaxMaxBlockAdditionID, 0x55EE, 2, KaxTracks, "MaxBlockAdditionID", 0);\r
-//DEFINE_MKX_SINTEGER_DEF(KaxTrackOffset, 0x537F, 2, KaxTracks, "TrackOffset", 0);\r
-DEFINE_MKX_UNISTRING (KaxTrackName, 0x536E, 2, KaxTracks, "TrackName");\r
-DEFINE_MKX_STRING_DEF (KaxTrackLanguage, 0x22B59C, 3, KaxTracks, "TrackLanguage", "eng");\r
-DEFINE_MKX_STRING (KaxCodecID, 0x86, 1, KaxTracks, "CodecID");\r
-DEFINE_MKX_BINARY (KaxCodecPrivate, 0x63A2, 2, KaxTracks, "CodecPrivate");\r
-DEFINE_MKX_UNISTRING (KaxCodecName, 0x258688, 3, KaxTracks, "CodecName");\r
-DEFINE_MKX_BINARY (KaxTrackAttachmentLink, 0x7446, 2, KaxTracks, "TrackAttachmentLink");\r
-DEFINE_MKX_UINTEGER (KaxTrackOverlay, 0x6FAB, 2, KaxTracks, "TrackOverlay");\r
-DEFINE_MKX_MASTER (KaxTrackTranslate, 0x6624, 2, KaxTracks, "TrackTranslate");\r
-DEFINE_MKX_UINTEGER (KaxTrackTranslateEditionUID, 0x66FC, 2, KaxTrackTranslate, "TrackTranslateEditionUID");\r
-DEFINE_MKX_UINTEGER (KaxTrackTranslateCodec, 0x66BF, 2, KaxTrackTranslate, "TrackTranslateCodec");\r
-DEFINE_MKX_BINARY (KaxTrackTranslateTrackID, 0x66A5, 2, KaxTrackTranslate, "TrackTranslateTrackID");\r
-#if MATROSKA_VERSION >= 2\r
-DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagEnabled, 0xB9, 1, KaxTracks, "TrackFlagDefault", 1);\r
-DEFINE_MKX_UNISTRING (KaxCodecSettings, 0x3A9697, 3, KaxTracks, "CodecSettings");\r
-DEFINE_MKX_STRING (KaxCodecInfoURL, 0x3B4040, 3, KaxTracks, "CodecInfoURL");\r
-DEFINE_MKX_STRING (KaxCodecDownloadURL, 0x26B240, 3, KaxTracks, "CodecDownloadURL");\r
-DEFINE_MKX_UINTEGER_DEF(KaxCodecDecodeAll, 0xAA, 1, KaxTracks, "CodecDecodeAll", 1);\r
-#endif\r
-\r
-END_LIBMATROSKA_NAMESPACE\r
+/****************************************************************************
+** libmatroska : parse Matroska files, see http://www.matroska.org/
+**
+** <file/class description>
+**
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
+**
+** This file is part of libmatroska.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License as published by the Free Software Foundation; either
+** version 2.1 of the License, or (at your option) any later version.
+**
+** This library is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** Lesser General Public License for more details.
+**
+** You should have received a copy of the GNU Lesser General Public
+** License along with this library; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+**
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
+** Contact license@matroska.org if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+/*!
+ \file
+ \version \$Id: KaxTrackEntryData.cpp 1201 2005-08-30 14:28:27Z robux4 $
+ \author Steve Lhomme <robux4 @ users.sf.net>
+ \author John Cannon <spyder2555 @ users.sf.net>
+*/
+#include "matroska/KaxTrackEntryData.h"
+#include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
+
+START_LIBMATROSKA_NAMESPACE
+
+DEFINE_START_SEMANTIC(KaxTrackTranslate)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTrackTranslateEditionUID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTranslateCodec)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTranslateTrackID)
+DEFINE_END_SEMANTIC(KaxTrackTranslate)
+
+DEFINE_MKX_UINTEGER (KaxTrackNumber, 0xD7, 1, KaxTrackEntry, "TrackNumber");
+DEFINE_MKX_UINTEGER (KaxTrackUID, 0x73C5, 2, KaxTrackEntry, "TrackUID");
+DEFINE_MKX_UINTEGER (KaxTrackType, 0x83, 1, KaxTrackEntry, "TrackType");
+DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagDefault, 0x88, 1, KaxTrackEntry, "TrackFlagDefault", 1);
+DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagForced, 0x55AA, 2, KaxTrackEntry, "TrackFlagForced", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagLacing, 0x9C, 1, KaxTrackEntry, "TrackFlagLacing", 1);
+DEFINE_MKX_UINTEGER_DEF(KaxTrackMinCache, 0x6DE7, 2, KaxTrackEntry, "TrackMinCache", 0);
+DEFINE_MKX_UINTEGER (KaxTrackMaxCache, 0x6DF8, 2, KaxTrackEntry, "TrackMaxCache\0rotomodobopo");
+DEFINE_MKX_UINTEGER (KaxTrackDefaultDuration, 0x23E383, 3, KaxTrackEntry, "TrackDefaultDuration");
+DEFINE_MKX_FLOAT_DEF (KaxTrackTimecodeScale, 0x23314F, 3, KaxTrackEntry, "TrackTimecodeScale", 1.0);
+DEFINE_MKX_UINTEGER_DEF(KaxMaxBlockAdditionID, 0x55EE, 2, KaxTrackEntry, "MaxBlockAdditionID", 0);
+//DEFINE_MKX_SINTEGER_DEF(KaxTrackOffset, 0x537F, 2, KaxTrackEntry, "TrackOffset", 0);
+DEFINE_MKX_UNISTRING (KaxTrackName, 0x536E, 2, KaxTrackEntry, "TrackName");
+DEFINE_MKX_STRING_DEF (KaxTrackLanguage, 0x22B59C, 3, KaxTrackEntry, "TrackLanguage", "eng");
+DEFINE_MKX_STRING (KaxCodecID, 0x86, 1, KaxTrackEntry, "CodecID");
+DEFINE_MKX_BINARY (KaxCodecPrivate, 0x63A2, 2, KaxTrackEntry, "CodecPrivate");
+DEFINE_MKX_UNISTRING (KaxCodecName, 0x258688, 3, KaxTrackEntry, "CodecName");
+DEFINE_MKX_UINTEGER (KaxTrackAttachmentLink, 0x7446, 2, KaxTrackEntry, "TrackAttachmentLink");
+DEFINE_MKX_UINTEGER (KaxTrackOverlay, 0x6FAB, 2, KaxTrackEntry, "TrackOverlay");
+DEFINE_MKX_MASTER (KaxTrackTranslate, 0x6624, 2, KaxTrackEntry, "TrackTranslate");
+DEFINE_MKX_UINTEGER (KaxTrackTranslateEditionUID, 0x66FC, 2, KaxTrackTranslate, "TrackTranslateEditionUID");
+DEFINE_MKX_UINTEGER (KaxTrackTranslateCodec, 0x66BF, 2, KaxTrackTranslate, "TrackTranslateCodec");
+DEFINE_MKX_BINARY (KaxTrackTranslateTrackID, 0x66A5, 2, KaxTrackTranslate, "TrackTranslateTrackID");
+#if MATROSKA_VERSION >= 2
+DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagEnabled, 0xB9, 1, KaxTrackEntry, "TrackFlagEnabled", 1);
+DEFINE_MKX_UNISTRING (KaxCodecSettings, 0x3A9697, 3, KaxTrackEntry, "CodecSettings");
+DEFINE_MKX_STRING (KaxCodecInfoURL, 0x3B4040, 3, KaxTrackEntry, "CodecInfoURL");
+DEFINE_MKX_STRING (KaxCodecDownloadURL, 0x26B240, 3, KaxTrackEntry, "CodecDownloadURL");
+DEFINE_MKX_UINTEGER_DEF(KaxCodecDecodeAll, 0xAA, 1, KaxTrackEntry, "CodecDecodeAll", 1);
+#endif
+
+END_LIBMATROSKA_NAMESPACE
DEFINE_SEMANTIC_ITEM(true, false, KaxTrackJoinUID)
DEFINE_END_SEMANTIC(KaxTrackJoinBlocks)
-DEFINE_MKX_MASTER (KaxTrackOperation, 0xE2, 1, KaxTracks, "TrackOperation");
+DEFINE_MKX_MASTER (KaxTrackOperation, 0xE2, 1, KaxTrackEntry, "TrackOperation");
DEFINE_MKX_MASTER (KaxTrackCombinePlanes, 0xE3, 1, KaxTrackOperation, "TrackCombinePlanes");
DEFINE_MKX_MASTER (KaxTrackPlane, 0xE4, 1, KaxTrackCombinePlanes, "TrackPlane");
DEFINE_MKX_UINTEGER(KaxTrackPlaneUID, 0xE5, 1, KaxTrackPlane, "TrackPlaneUID");