+static EbmlSyntax matroska_seekhead_entry[] = {
+ { MATROSKA_ID_SEEKID, EBML_UINT, 0, offsetof(MatroskaSeekhead,id) },
+ { MATROSKA_ID_SEEKPOSITION, EBML_UINT, 0, offsetof(MatroskaSeekhead,pos), {.u=-1} },
+ { 0 }
+};
+
+static EbmlSyntax matroska_seekhead[] = {
+ { MATROSKA_ID_SEEKENTRY, EBML_NEST, sizeof(MatroskaSeekhead), offsetof(MatroskaDemuxContext,seekhead), {.n=matroska_seekhead_entry} },
+ { 0 }
+};
+
+static EbmlSyntax matroska_segment[] = {
+ { MATROSKA_ID_INFO, EBML_NEST, 0, 0, {.n=matroska_info } },
+ { MATROSKA_ID_TRACKS, EBML_NEST, 0, 0, {.n=matroska_tracks } },
+ { MATROSKA_ID_ATTACHMENTS, EBML_NEST, 0, 0, {.n=matroska_attachments} },
+ { MATROSKA_ID_CHAPTERS, EBML_NEST, 0, 0, {.n=matroska_chapters } },
+ { MATROSKA_ID_CUES, EBML_NEST, 0, 0, {.n=matroska_index } },
+ { MATROSKA_ID_TAGS, EBML_NEST, 0, 0, {.n=matroska_tags } },
+ { MATROSKA_ID_SEEKHEAD, EBML_NEST, 0, 0, {.n=matroska_seekhead } },
+ { MATROSKA_ID_CLUSTER, EBML_STOP, 0, offsetof(MatroskaDemuxContext,has_cluster_id) },
+ { 0 }
+};
+
+static EbmlSyntax matroska_segments[] = {
+ { MATROSKA_ID_SEGMENT, EBML_NEST, 0, 0, {.n=matroska_segment } },
+ { 0 }
+};
+
+static EbmlSyntax matroska_blockgroup[] = {
+ { MATROSKA_ID_BLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) },
+ { MATROSKA_ID_SIMPLEBLOCK, EBML_BIN, 0, offsetof(MatroskaBlock,bin) },
+ { MATROSKA_ID_BLOCKDURATION, EBML_UINT, 0, offsetof(MatroskaBlock,duration), {.u=AV_NOPTS_VALUE} },
+ { MATROSKA_ID_BLOCKREFERENCE, EBML_UINT, 0, offsetof(MatroskaBlock,reference) },
+ { 0 }
+};
+
+static EbmlSyntax matroska_cluster[] = {
+ { MATROSKA_ID_CLUSTERTIMECODE,EBML_UINT,0, offsetof(MatroskaCluster,timecode) },
+ { MATROSKA_ID_BLOCKGROUP, EBML_NEST, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
+ { MATROSKA_ID_SIMPLEBLOCK, EBML_PASS, sizeof(MatroskaBlock), offsetof(MatroskaCluster,blocks), {.n=matroska_blockgroup} },
+ { MATROSKA_ID_CLUSTERPOSITION,EBML_NONE },
+ { MATROSKA_ID_CLUSTERPREVSIZE,EBML_NONE },
+ { 0 }
+};
+
+static EbmlSyntax matroska_clusters[] = {
+ { MATROSKA_ID_CLUSTER, EBML_NEST, 0, 0, {.n=matroska_cluster} },
+ { MATROSKA_ID_INFO, EBML_NONE },
+ { MATROSKA_ID_CUES, EBML_NONE },
+ { MATROSKA_ID_TAGS, EBML_NONE },
+ { MATROSKA_ID_SEEKHEAD, EBML_NONE },
+ { 0 }
+};
+
+#define SIZE_OFF(x) sizeof(((AVFormatContext*)0)->x),offsetof(AVFormatContext,x)
+const struct {
+ const char name[16];
+ int size;
+ int offset;
+} metadata[] = {
+ { "TITLE", SIZE_OFF(title) },
+ { "ARTIST", SIZE_OFF(author) },
+ { "WRITTEN_BY", SIZE_OFF(author) },
+ { "LEAD_PERFORMER", SIZE_OFF(author) },
+ { "COPYRIGHT", SIZE_OFF(copyright) },
+ { "COMMENT", SIZE_OFF(comment) },
+ { "ALBUM", SIZE_OFF(album) },
+ { "DATE_WRITTEN", SIZE_OFF(year) },
+ { "DATE_RELEASED", SIZE_OFF(year) },
+ { "PART_NUMBER", SIZE_OFF(track) },
+ { "GENRE", SIZE_OFF(genre) },
+};