diff --git a/libavformat/matroskasem.c b/libavformat/matroskasem.c
index 0f4455058a..cdef0dbff4 100644
--- a/libavformat/matroskasem.c
+++ b/libavformat/matroskasem.c
@@ -37,6 +37,35 @@
 
 #define CHILD_OF(parent) { .def = { .n = parent } }
 
+// The following forward declarations need their size because
+// a tentative definition with internal linkage must not be an
+// incomplete type (6.7.2 in C90, 6.9.2 in C99).
+// Removing the sizes breaks MSVC.
+static EbmlSyntax matroska_seekhead[2];
+static EbmlSyntax matroska_info[8];
+static EbmlSyntax matroska_blockadditions[2];
+// static EbmlSyntax matroska_blockgroup[8];
+// static EbmlSyntax matroska_cluster_parsing[8];
+static EbmlSyntax matroska_track_video_color[15];
+static EbmlSyntax matroska_track_video[19];
+static EbmlSyntax matroska_track_combine_planes[2];
+static EbmlSyntax matroska_track_operation[2];
+static EbmlSyntax matroska_track_encoding_encryption[8];
+static EbmlSyntax matroska_track_encoding[6];
+static EbmlSyntax matroska_track_encodings[2];
+static EbmlSyntax matroska_track[33];
+static EbmlSyntax matroska_tracks[2];
+static EbmlSyntax matroska_index_pos[6];
+static EbmlSyntax matroska_index_entry[3];
+static EbmlSyntax matroska_index[2];
+static EbmlSyntax matroska_attachments[2];
+static EbmlSyntax matroska_chapter_entry[9];
+static EbmlSyntax matroska_chapter[6];
+static EbmlSyntax matroska_chapters[2];
+static EbmlSyntax matroska_tag[3];
+static EbmlSyntax matroska_tags[2];
+
+
 static EbmlSyntax ebml_header[] = {
     { EBML_ID_EBMLREADVERSION,    EBML_UINT, 0, 0, offsetof(Ebml, version),         { .u = EBML_VERSION } },
     { EBML_ID_EBMLMAXSIZELENGTH,  EBML_UINT, 0, 0, offsetof(Ebml, max_size),        { .u = 8 } },
@@ -77,7 +106,7 @@ static EbmlSyntax matroska_mastering_meta[] = {
     CHILD_OF(matroska_track_video_color)
 };
 
-EbmlSyntax matroska_track_video_color[] = {
+static EbmlSyntax matroska_track_video_color[] = {
     { MATROSKA_ID_VIDEOCOLORMATRIXCOEFF,      EBML_UINT,  0, 0, offsetof(MatroskaTrackVideoColor, matrix_coefficients), { .u = AVCOL_SPC_UNSPECIFIED } },
     { MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL,   EBML_UINT,  0, 0, offsetof(MatroskaTrackVideoColor, bits_per_channel) },
     { MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ,    EBML_UINT,  0, 0, offsetof(MatroskaTrackVideoColor, chroma_sub_horz) },
@@ -95,7 +124,7 @@ EbmlSyntax matroska_track_video_color[] = {
     CHILD_OF(matroska_track_video)
 };
 
-EbmlSyntax matroska_track_video[] = {
+static EbmlSyntax matroska_track_video[] = {
     { MATROSKA_ID_VIDEOFRAMERATE,             EBML_FLOAT, 0, 0, offsetof(MatroskaTrackVideo, frame_rate) },
     { MATROSKA_ID_VIDEODISPLAYWIDTH,          EBML_UINT,  0, 0, offsetof(MatroskaTrackVideo, display_width), { .u = -1 } },
     { MATROSKA_ID_VIDEODISPLAYHEIGHT,         EBML_UINT,  0, 0, offsetof(MatroskaTrackVideo, display_height), { .u = -1 } },
@@ -117,18 +146,18 @@ EbmlSyntax matroska_track_video[] = {
     CHILD_OF(matroska_track)
 };
 
-EbmlSyntax matroska_track_plane[] = {
+static EbmlSyntax matroska_track_plane[] = {
     { MATROSKA_ID_TRACKPLANEUID,              EBML_UINT,  0, 0, offsetof(MatroskaTrackPlane, uid) },
     { MATROSKA_ID_TRACKPLANETYPE,             EBML_UINT,  0, 0, offsetof(MatroskaTrackPlane, type) },
     CHILD_OF(matroska_track_combine_planes)
 };
 
-EbmlSyntax matroska_track_combine_planes[] = {
+static EbmlSyntax matroska_track_combine_planes[] = {
     { MATROSKA_ID_TRACKPLANE,                 EBML_NEST,  0, sizeof(MatroskaTrackPlane), offsetof(MatroskaTrackOperation, combine_planes), { .n = matroska_track_plane } },
     CHILD_OF(matroska_track_operation)
 };
 
-EbmlSyntax matroska_track_operation[] = {
+static EbmlSyntax matroska_track_operation[] = {
     { MATROSKA_ID_TRACKCOMBINEPLANES,         EBML_NEST,  0, 0, 0, { .n = matroska_track_combine_planes } },
     CHILD_OF(matroska_track)
 };
@@ -150,7 +179,7 @@ static EbmlSyntax matroska_track_encoding_compression[] = {
     CHILD_OF(matroska_track_encoding)
 };
 
-EbmlSyntax matroska_track_encoding[] = {
+static EbmlSyntax matroska_track_encoding[] = {
     { MATROSKA_ID_ENCODINGSCOPE,              EBML_UINT,  0, 0, offsetof(MatroskaTrackEncoding, scope), { .u = 1 } },
     { MATROSKA_ID_ENCODINGTYPE,               EBML_UINT,  0, 0, offsetof(MatroskaTrackEncoding, type) },
     { MATROSKA_ID_ENCODINGCOMPRESSION,        EBML_NEST,  0, 0, offsetof(MatroskaTrackEncoding, compression), { .n = matroska_track_encoding_compression } },
@@ -159,12 +188,12 @@ EbmlSyntax matroska_track_encoding[] = {
     CHILD_OF(matroska_track_encodings)
 };
 
-EbmlSyntax matroska_track_encodings[] = {
+static EbmlSyntax matroska_track_encodings[] = {
     { MATROSKA_ID_TRACKCONTENTENCODING,       EBML_NEST,  0, sizeof(MatroskaTrackEncoding), offsetof(MatroskaTrack, encodings), { .n = matroska_track_encoding } },
     CHILD_OF(matroska_track)
 };
 
-EbmlSyntax matroska_block_addition_mapping[] = {
+static EbmlSyntax matroska_block_addition_mapping[] = {
     { MATROSKA_ID_BLKADDIDNAME,               EBML_STR,   0, 0, offsetof(MatroskaBlockAdditionMapping, name) },
     { MATROSKA_ID_BLKADDIDTYPE,               EBML_UINT,  0, 0, offsetof(MatroskaBlockAdditionMapping, type) },
     { MATROSKA_ID_BLKADDIDEXTRADATA,          EBML_BIN,   0, 0, offsetof(MatroskaBlockAdditionMapping, extradata) },
@@ -180,7 +209,7 @@ static EbmlSyntax matroska_track_audio[] = {
     CHILD_OF(matroska_track)
 };
 
-EbmlSyntax matroska_track[] = {
+static EbmlSyntax matroska_track[] = {
     { MATROSKA_ID_TRACKNUMBER,                EBML_UINT,  0, 0, offsetof(MatroskaTrack, num) },
     { MATROSKA_ID_TRACKNAME,                  EBML_UTF8,  0, 0, offsetof(MatroskaTrack, name) },
     { MATROSKA_ID_TRACKUID,                   EBML_UINT,  0, 0, offsetof(MatroskaTrack, uid) },
@@ -216,7 +245,7 @@ EbmlSyntax matroska_track[] = {
     CHILD_OF(matroska_tracks)
 };
 
-EbmlSyntax matroska_tracks[] = {
+static EbmlSyntax matroska_tracks[] = {
     { MATROSKA_ID_TRACKENTRY,                 EBML_NEST,  0, sizeof(MatroskaTrack), offsetof(MatroskaDemuxContext, tracks), { .n = matroska_track } },
     CHILD_OF(matroska_segment)
 };
@@ -240,13 +269,13 @@ static EbmlSyntax matroska_simpletag[] = {
     CHILD_OF(matroska_tag)
 };
 
-EbmlSyntax matroska_tag[] = {
+static EbmlSyntax matroska_tag[] = {
     { MATROSKA_ID_SIMPLETAG,                  EBML_NEST,  0, sizeof(MatroskaTag), offsetof(MatroskaTags, tag), { .n = matroska_simpletag } },
     { MATROSKA_ID_TAGTARGETS,                 EBML_NEST,  0, 0, offsetof(MatroskaTags, target), { .n = matroska_tagtargets } },
     CHILD_OF(matroska_tags)
 };
 
-EbmlSyntax matroska_tags[] = {
+static EbmlSyntax matroska_tags[] = {
     { MATROSKA_ID_TAG,                        EBML_NEST,  0, sizeof(MatroskaTags), offsetof(MatroskaDemuxContext, tags), { .n = matroska_tag } },
     CHILD_OF(matroska_segment)
 };
@@ -257,7 +286,7 @@ static EbmlSyntax matroska_seekhead_entry[] = {
     CHILD_OF(matroska_seekhead)
 };
 
-EbmlSyntax matroska_seekhead[] = {
+static EbmlSyntax matroska_seekhead[] = {
     { MATROSKA_ID_SEEKENTRY,                  EBML_NEST,  0, sizeof(MatroskaSeekhead), offsetof(MatroskaDemuxContext, seekhead), { .n = matroska_seekhead_entry } },
     CHILD_OF(matroska_segment)
 };
@@ -282,13 +311,13 @@ static EbmlSyntax matroska_index_pos[] = {
     CHILD_OF(matroska_index_entry)
 };
 
-EbmlSyntax matroska_index_entry[] = {
+static EbmlSyntax matroska_index_entry[] = {
     { MATROSKA_ID_CUETIME,                    EBML_UINT,  0, 0, offsetof(MatroskaIndex, time) },
     { MATROSKA_ID_CUETRACKPOSITION,           EBML_NEST,  0, sizeof(MatroskaIndexPos), offsetof(MatroskaIndex, pos), { .n = matroska_index_pos } },
     CHILD_OF(matroska_index)
 };
 
-EbmlSyntax matroska_index[] = {
+static EbmlSyntax matroska_index[] = {
     { MATROSKA_ID_POINTENTRY,                 EBML_NEST,  0, sizeof(MatroskaIndex), offsetof(MatroskaDemuxContext, index), { .n = matroska_index_entry } },
     CHILD_OF(matroska_segment)
 };
@@ -299,7 +328,7 @@ static EbmlSyntax matroska_blockmore[] = {
     CHILD_OF(matroska_blockadditions)
 };
 
-EbmlSyntax matroska_blockadditions[] = {
+static EbmlSyntax matroska_blockadditions[] = {
     { MATROSKA_ID_BLOCKMORE,                  EBML_NEST,  0, 0, 0, { .n = matroska_blockmore } },
     CHILD_OF(matroska_blockgroup)
 };
@@ -335,7 +364,7 @@ static EbmlSyntax matroska_chapter_display[] = {
     CHILD_OF(matroska_chapter_entry)
 };
 
-EbmlSyntax matroska_chapter_entry[] = {
+static EbmlSyntax matroska_chapter_entry[] = {
     { MATROSKA_ID_CHAPTERTIMESTART,           EBML_UINT,  0, 0, offsetof(MatroskaChapter, start), { .u = AV_NOPTS_VALUE } },
     { MATROSKA_ID_CHAPTERTIMEEND,             EBML_UINT,  0, 0, offsetof(MatroskaChapter, end), { .u = AV_NOPTS_VALUE } },
     { MATROSKA_ID_CHAPTERUID,                 EBML_UINT,  0, 0, offsetof(MatroskaChapter, uid) },
@@ -347,7 +376,7 @@ EbmlSyntax matroska_chapter_entry[] = {
     CHILD_OF(matroska_chapter)
 };
 
-EbmlSyntax matroska_chapter[] = {
+static EbmlSyntax matroska_chapter[] = {
     { MATROSKA_ID_CHAPTERATOM,                EBML_NEST,  0, sizeof(MatroskaChapter), offsetof(MatroskaDemuxContext, chapters), { .n = matroska_chapter_entry } },
     { MATROSKA_ID_EDITIONUID,                 EBML_NONE },
     { MATROSKA_ID_EDITIONFLAGDEFAULT,         EBML_NONE },
@@ -356,7 +385,7 @@ EbmlSyntax matroska_chapter[] = {
     CHILD_OF(matroska_chapters)
 };
 
-EbmlSyntax matroska_chapters[] = {
+static EbmlSyntax matroska_chapters[] = {
     { MATROSKA_ID_EDITIONENTRY,               EBML_NEST,  0, 0, 0, { .n = matroska_chapter } },
     CHILD_OF(matroska_segment)
 };
@@ -370,7 +399,7 @@ static EbmlSyntax matroska_attachment[] = {
     CHILD_OF(matroska_attachments)
 };
 
-EbmlSyntax matroska_attachments[] = {
+static EbmlSyntax matroska_attachments[] = {
     { MATROSKA_ID_ATTACHEDFILE,               EBML_NEST,  0, sizeof(MatroskaAttachment), offsetof(MatroskaDemuxContext, attachments), { .n = matroska_attachment } },
     CHILD_OF(matroska_segment)
 };
diff --git a/libavformat/matroskasem.h b/libavformat/matroskasem.h
index 01008b00bb..55ce97ef7a 100644
--- a/libavformat/matroskasem.h
+++ b/libavformat/matroskasem.h
@@ -381,12 +381,7 @@ typedef struct MatroskaDemuxContext {
 // a tentative definition with internal linkage must not be an
 // incomplete type (6.7.2 in C90, 6.9.2 in C99).
 // Removing the sizes breaks MSVC.
-EbmlSyntax ebml_syntax[3], matroska_segment[9], matroska_track_video_color[15], matroska_track_video[19],
-                  matroska_track[33], matroska_track_encoding[6], matroska_track_encodings[2],
-                  matroska_track_combine_planes[2], matroska_track_operation[2], matroska_block_addition_mapping[5], matroska_tracks[2],
-                  matroska_attachments[2], matroska_chapter_entry[9], matroska_chapter[6], matroska_chapters[2],
-                  matroska_index_entry[3], matroska_index[2], matroska_tag[3], matroska_tags[2], matroska_seekhead[2],
-                  matroska_blockadditions[2], matroska_blockgroup[8], matroska_cluster_parsing[8];
+EbmlSyntax ebml_syntax[3], matroska_segment[9], matroska_blockgroup[8], matroska_cluster_parsing[8];
 
 EbmlSyntax matroska_segments[2];
 EbmlSyntax matroska_cluster_enter[2];
