diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 12c22184a3..d5c69d8d77 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -376,9 +376,9 @@ static int start_ebml_master_crc32(AVIOContext **dyn_cp, MatroskaMuxContext *mkv
 }
 
 static int end_ebml_master_crc32(AVIOContext *pb, AVIOContext **dyn_cp,
-                                  MatroskaMuxContext *mkv, uint32_t id,
-                                  int length_size, int keep_buffer,
-                                  int add_seekentry)
+                                 MatroskaMuxContext *mkv, uint32_t id,
+                                 int length_size, int keep_buffer,
+                                 int add_seekentry)
 {
     uint8_t *buf, crc[4];
     int ret, size, skip = 0;
@@ -413,11 +413,11 @@ fail:
  * Furthermore always add a SeekHead Entry for this element.
  */
 static int end_ebml_master_crc32_tentatively(AVIOContext *pb,
-                                              ebml_stored_master *elem,
-                                              MatroskaMuxContext *mkv, uint32_t id)
+                                             ebml_stored_master *elem,
+                                             MatroskaMuxContext *mkv, uint32_t id)
 {
     if ((pb->seekable & AVIO_SEEKABLE_NORMAL) && !mkv->is_live) {
-    uint8_t *buf;
+        uint8_t *buf;
         int size = avio_get_dyn_buf(elem->bc, &buf);
 
         if (elem->bc->error < 0)
@@ -426,9 +426,9 @@ static int end_ebml_master_crc32_tentatively(AVIOContext *pb,
         elem->pos = avio_tell(pb);
         mkv_add_seekhead_entry(mkv, id, elem->pos);
 
-    put_ebml_id(pb, id);
-    put_ebml_length(pb, size, 0);
-    avio_write(pb, buf, size);
+        put_ebml_id(pb, id);
+        put_ebml_length(pb, size, 0);
+        avio_write(pb, buf, size);
 
         return 0;
     } else
@@ -816,17 +816,17 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb,
     }
 
     if (ret >= 0) {
-    codecpriv_size = avio_get_dyn_buf(dyn_cp, &codecpriv);
+        codecpriv_size = avio_get_dyn_buf(dyn_cp, &codecpriv);
         if ((ret = dyn_cp->error) >= 0 && codecpriv_size)
-        put_ebml_binary(pb, MATROSKA_ID_CODECPRIVATE, codecpriv,
-                        codecpriv_size);
+            put_ebml_binary(pb, MATROSKA_ID_CODECPRIVATE, codecpriv,
+                            codecpriv_size);
     }
     ffio_free_dyn_buf(&dyn_cp);
     return ret;
 }
 
-static void mkv_write_video_color(AVIOContext *pb, const AVCodecParameters *par,
-                                 const AVStream *st)
+static void mkv_write_video_color(AVIOContext *pb, const AVStream *st,
+                                  const AVCodecParameters *par)
 {
     /* 18 Elements with two bytes ID, one byte length field, 8 bytes payload
      * a master element with two bytes ID and one byte length field
@@ -1304,7 +1304,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
             uint32_t color_space = av_le2ne32(par->codec_tag);
             put_ebml_binary(pb, MATROSKA_ID_VIDEOCOLORSPACE, &color_space, sizeof(color_space));
         }
-        mkv_write_video_color(pb, par, st);
+        mkv_write_video_color(pb, st, par);
 
         ret = mkv_write_video_projection(s, pb, st);
         if (ret < 0)
@@ -1441,7 +1441,7 @@ static int mkv_write_tracks(AVFormatContext *s)
     }
 
     return end_ebml_master_crc32_tentatively(pb, &mkv->track, mkv,
-                                      MATROSKA_ID_TRACKS);
+                                             MATROSKA_ID_TRACKS);
 }
 
 static int mkv_write_chapters(AVFormatContext *s)
@@ -1693,7 +1693,7 @@ static int mkv_write_tags(AVFormatContext *s)
 
     if (mkv->tags.bc) {
         return end_ebml_master_crc32_tentatively(s->pb, &mkv->tags, mkv,
-                                          MATROSKA_ID_TAGS);
+                                                 MATROSKA_ID_TAGS);
     }
     return 0;
 }
@@ -2466,7 +2466,7 @@ static int mkv_write_trailer(AVFormatContext *s)
 
     if (mkv->cluster_bc) {
         ret = end_ebml_master_crc32(pb, &mkv->cluster_bc, mkv,
-                              MATROSKA_ID_CLUSTER, 0, 0, 0);
+                                    MATROSKA_ID_CLUSTER, 0, 0, 0);
         if (ret < 0)
             return ret;
     }
@@ -2526,7 +2526,7 @@ static int mkv_write_trailer(AVFormatContext *s)
                 }
             }
             ret = end_ebml_master_crc32(pb, &cues, mkv, MATROSKA_ID_CUES,
-                                  length_size, 0, 1);
+                                        length_size, 0, 1);
             if (ret < 0)
                 return ret;
             if (mkv->reserve_cues_space) {
@@ -2554,7 +2554,7 @@ static int mkv_write_trailer(AVFormatContext *s)
             // write Tracks master
             avio_seek(pb, mkv->track.pos, SEEK_SET);
             ret = end_ebml_master_crc32(pb, &mkv->track.bc, mkv,
-                                  MATROSKA_ID_TRACKS, 0, 0, 0);
+                                        MATROSKA_ID_TRACKS, 0, 0, 0);
             if (ret < 0)
                 return ret;
         }
@@ -2585,7 +2585,7 @@ static int mkv_write_trailer(AVFormatContext *s)
 
             avio_seek(pb, mkv->tags.pos, SEEK_SET);
             ret = end_ebml_master_crc32(pb, &mkv->tags.bc, mkv,
-                                  MATROSKA_ID_TAGS, 0, 0, 0);
+                                        MATROSKA_ID_TAGS, 0, 0, 0);
             if (ret < 0)
                 return ret;
         }