[FFmpeg-cvslog] avformat/fitsenc: Simplify writing header padding

Andreas Rheinhardt git at videolan.org
Thu Apr 28 04:24:32 EEST 2022


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Apr 22 20:36:56 2022 +0200| [52af16bbf5386410872f45f17b25ecb9ff40b97f] | committer: Andreas Rheinhardt

avformat/fitsenc: Simplify writing header padding

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=52af16bbf5386410872f45f17b25ecb9ff40b97f
---

 libavformat/fitsenc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavformat/fitsenc.c b/libavformat/fitsenc.c
index 5cf34ef067..37ee10bb13 100644
--- a/libavformat/fitsenc.c
+++ b/libavformat/fitsenc.c
@@ -24,6 +24,7 @@
  * FITS muxer.
  */
 
+#include "avio_internal.h"
 #include "internal.h"
 
 typedef struct FITSContext {
@@ -177,11 +178,7 @@ static int write_image_header(AVFormatContext *s)
     lines_written++;
 
     lines_left = ((lines_written + 35) / 36) * 36 - lines_written;
-    memset(buffer, ' ', 80);
-    while (lines_left > 0) {
-        avio_write(s->pb, buffer, sizeof(buffer));
-        lines_left--;
-    }
+    ffio_fill(s->pb, ' ', sizeof(buffer) * lines_left);
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list