diff mbox series

[FFmpeg-devel,04/27] avformat/filmstripenc: Simplify writing reserved elements

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

Commit Message

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

Patch

diff --git a/libavformat/filmstripenc.c b/libavformat/filmstripenc.c
index 48f483bc90..ebb7294175 100644
--- a/libavformat/filmstripenc.c
+++ b/libavformat/filmstripenc.c
@@ -26,6 +26,7 @@ 
 
 #include "libavutil/intreadwrite.h"
 #include "avformat.h"
+#include "avio_internal.h"
 #include "rawenc.h"
 
 #define RAND_TAG MKBETAG('R','a','n','d')
@@ -43,7 +44,6 @@  static int write_trailer(AVFormatContext *s)
 {
     AVIOContext *pb = s->pb;
     AVStream *st = s->streams[0];
-    int i;
 
     avio_wb32(pb, RAND_TAG);
     avio_wb32(pb, st->nb_frames);
@@ -54,8 +54,7 @@  static int write_trailer(AVFormatContext *s)
     avio_wb16(pb, 0);  // leading
     // TODO: should be avg_frame_rate
     avio_wb16(pb, st->time_base.den / st->time_base.num);
-    for (i = 0; i < 16; i++)
-        avio_w8(pb, 0x00);  // reserved
+    ffio_fill(pb, 0x00, 16);  // reserved
 
     return 0;
 }