diff --git a/libavformat/matroska_ids.h b/libavformat/matroska_ids.h
index 09579052c4..ab1d84337a 100644
--- a/libavformat/matroska_ids.h
+++ b/libavformat/matroska_ids.h
@@ -58,9 +58,16 @@
 #define MATROSKA_ID_TRACKVIDEO     0xE0
 #define MATROSKA_ID_TRACKAUDIO     0xE1
 #define MATROSKA_ID_TRACKOPERATION 0xE2
+#define MATROSKA_ID_TRACKFLAGHEARINGIMPAIRED  0x55AB
+#define MATROSKA_ID_TRACKFLAGVISUALIMPAIRED   0x55AC
+#define MATROSKA_ID_TRACKFLAGTEXTDESCRIPTIONS 0x55AD
+#define MATROSKA_ID_TRACKFLAGORIGINAL         0x55AE
+#define MATROSKA_ID_TRACKFLAGCOMMENTARY       0x55AF
 #define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F
 #define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE
 #define MATROSKA_ID_TRACKBLKADDMAPPING 0x41E4
+#define MATROSKA_ID_TRACKNAME  0x536E
+#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C
 #define MATROSKA_ID_CODECID    0x86
 #define MATROSKA_ID_CODECPRIVATE 0x63A2
 #define MATROSKA_ID_CODECNAME  0x258688
@@ -69,25 +76,44 @@
 #define MATROSKA_ID_CODECDECODEALL 0xAA
 #define MATROSKA_ID_CODECDELAY 0x56AA
 #define MATROSKA_ID_SEEKPREROLL 0x56BB
-#define MATROSKA_ID_TRACKNAME  0x536E
-#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C
 #define MATROSKA_ID_TRACKFLAGENABLED 0xB9
 #define MATROSKA_ID_TRACKFLAGDEFAULT 0x88
 #define MATROSKA_ID_TRACKFLAGFORCED 0x55AA
-#define MATROSKA_ID_TRACKFLAGHEARINGIMPAIRED  0x55AB
-#define MATROSKA_ID_TRACKFLAGVISUALIMPAIRED   0x55AC
-#define MATROSKA_ID_TRACKFLAGTEXTDESCRIPTIONS 0x55AD
-#define MATROSKA_ID_TRACKFLAGORIGINAL         0x55AE
-#define MATROSKA_ID_TRACKFLAGCOMMENTARY       0x55AF
 #define MATROSKA_ID_TRACKFLAGLACING 0x9C
 #define MATROSKA_ID_TRACKMINCACHE 0x6DE7
 #define MATROSKA_ID_TRACKMAXCACHE 0x6DF8
 #define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383
 #define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80
 
+/* IDs in the block addition mapping master */
+#define MATROSKA_ID_BLKADDIDNAME 0x41A4
+#define MATROSKA_ID_BLKADDIDTYPE 0x41E7
+#define MATROSKA_ID_BLKADDIDEXTRADATA 0x41ED
+#define MATROSKA_ID_BLKADDIDVALUE 0x41F0
+
 /* IDs in the contentencodings master */
 #define MATROSKA_ID_TRACKCONTENTENCODING 0x6240
 
+/* IDs in the content encoding master */
+#define MATROSKA_ID_ENCODINGORDER 0x5031
+#define MATROSKA_ID_ENCODINGSCOPE 0x5032
+#define MATROSKA_ID_ENCODINGTYPE 0x5033
+#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034
+#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035
+
+/* IDs in the contentcompression master */
+#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254
+#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255
+
+/* IDs in the contentencryption master */
+#define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7
+#define MATROSKA_ID_ENCODINGENCALGO 0x47E1
+#define MATROSKA_ID_ENCODINGENCKEYID 0x47E2
+#define MATROSKA_ID_ENCODINGSIGALGO 0x47E5
+#define MATROSKA_ID_ENCODINGSIGHASHALGO 0x47E6
+#define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4
+#define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3
+
 /* IDs in the trackoperation master */
 #define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3
 
@@ -162,32 +188,6 @@
 #define MATROSKA_ID_AUDIOBITDEPTH 0x6264
 #define MATROSKA_ID_AUDIOCHANNELS 0x9F
 
-/* IDs in the content encoding master */
-#define MATROSKA_ID_ENCODINGORDER 0x5031
-#define MATROSKA_ID_ENCODINGSCOPE 0x5032
-#define MATROSKA_ID_ENCODINGTYPE 0x5033
-#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034
-#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035
-
-/* IDs in the contentcompression master */
-#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254
-#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255
-
-/* IDs in the contentencryption master */
-#define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7
-#define MATROSKA_ID_ENCODINGENCALGO 0x47E1
-#define MATROSKA_ID_ENCODINGENCKEYID 0x47E2
-#define MATROSKA_ID_ENCODINGSIGALGO 0x47E5
-#define MATROSKA_ID_ENCODINGSIGHASHALGO 0x47E6
-#define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4
-#define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3
-
-/* IDs in the block addition mapping master */
-#define MATROSKA_ID_BLKADDIDVALUE 0x41F0
-#define MATROSKA_ID_BLKADDIDNAME 0x41A4
-#define MATROSKA_ID_BLKADDIDTYPE 0x41E7
-#define MATROSKA_ID_BLKADDIDEXTRADATA 0x41ED
-
 /* IDs in the cues master */
 #define MATROSKA_ID_POINTENTRY 0xBB
 
@@ -223,19 +223,15 @@
 #define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4
 #define MATROSKA_ID_TAGTARGETS_ATTACHUID  0x63C6
 
-/* IDs in the blockadditions master */
-#define MATROSKA_ID_BLOCKMORE 0xA6
-
-/* IDs in the blockmore master */
-#define MATROSKA_ID_BLOCKADDID 0xEE
-#define MATROSKA_ID_BLOCKADDITIONAL 0xA5
-
-/* IDs in the seekhead master */
-#define MATROSKA_ID_SEEKENTRY  0x4DBB
+/* IDs in the attachments master */
+#define MATROSKA_ID_ATTACHEDFILE        0x61A7
 
-/* IDs in the seekpoint master */
-#define MATROSKA_ID_SEEKID     0x53AB
-#define MATROSKA_ID_SEEKPOSITION 0x53AC
+/* IDs in the attachedfile master */
+#define MATROSKA_ID_FILEDESC            0x467E
+#define MATROSKA_ID_FILENAME            0x466E
+#define MATROSKA_ID_FILEMIMETYPE        0x4660
+#define MATROSKA_ID_FILEDATA            0x465C
+#define MATROSKA_ID_FILEUID             0x46AE
 
 /* IDs in the cluster master */
 #define MATROSKA_ID_CLUSTERTIMECODE 0xE7
@@ -252,15 +248,19 @@
 #define MATROSKA_ID_CODECSTATE 0xA4
 #define MATROSKA_ID_DISCARDPADDING 0x75A2
 
-/* IDs in the attachments master */
-#define MATROSKA_ID_ATTACHEDFILE        0x61A7
+/* IDs in the blockadditions master */
+#define MATROSKA_ID_BLOCKMORE 0xA6
 
-/* IDs in the attachedfile master */
-#define MATROSKA_ID_FILEDESC            0x467E
-#define MATROSKA_ID_FILENAME            0x466E
-#define MATROSKA_ID_FILEMIMETYPE        0x4660
-#define MATROSKA_ID_FILEDATA            0x465C
-#define MATROSKA_ID_FILEUID             0x46AE
+/* IDs in the blockmore master */
+#define MATROSKA_ID_BLOCKADDID 0xEE
+#define MATROSKA_ID_BLOCKADDITIONAL 0xA5
+
+/* IDs in the seekhead master */
+#define MATROSKA_ID_SEEKENTRY  0x4DBB
+
+/* IDs in the seekpoint master */
+#define MATROSKA_ID_SEEKID     0x53AB
+#define MATROSKA_ID_SEEKPOSITION 0x53AC
 
 /* IDs in the chapters master */
 #define MATROSKA_ID_EDITIONENTRY        0x45B9
