diff mbox series

[FFmpeg-devel,23/27] avformat/omaenc: Simplify writing padding

Message ID AM7PR03MB6660330B9B2A6BD9FC3C278C8FA39@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit c8e75076f1d5a53a58da9d14574721f9404c99d4
Headers show
Series [FFmpeg-devel,01/27] avformat/astenc: Simplify writing padding | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 23, 2021, 3:28 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/omaenc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/omaenc.c b/libavformat/omaenc.c
index ec71956fbd..1c4edcac5c 100644
--- a/libavformat/omaenc.c
+++ b/libavformat/omaenc.c
@@ -29,7 +29,6 @@ 
 
 static av_cold int oma_write_header(AVFormatContext *s)
 {
-    int i;
     AVCodecParameters *par;
     int srate_index;
     int isjointstereo;
@@ -55,8 +54,7 @@  static av_cold int oma_write_header(AVFormatContext *s)
     avio_w8(s->pb, EA3_HEADER_SIZE >> 7);
     avio_w8(s->pb, EA3_HEADER_SIZE & 0x7F);
     avio_wl16(s->pb, 0xFFFF);       /* not encrypted */
-    for (i = 0; i < 6; i++)
-        avio_wl32(s->pb, 0);        /* Padding + DRM id */
+    ffio_fill(s->pb, 0, 6 * 4);     /* Padding + DRM id */
 
     switch (par->codec_tag) {
     case OMA_CODECID_ATRAC3:
@@ -88,8 +86,7 @@  static av_cold int oma_write_header(AVFormatContext *s)
                av_fourcc2str(par->codec_tag));
         return AVERROR(EINVAL);
     }
-    for (i = 0; i < (EA3_HEADER_SIZE - 36)/4; i++)
-        avio_wl32(s->pb, 0);        /* Padding */
+    ffio_fill(s->pb, 0, EA3_HEADER_SIZE - 36);  /* Padding */
 
     return 0;
 }