[FFmpeg-cvslog] avformat/segafilmenc: Simplify writing two bytes

Andreas Rheinhardt git at videolan.org
Sun Jul 26 18:23:33 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Fri Jul 17 09:11:53 2020 +0200| [37ec33f42c42f0058b3271d79096dbc215b1902e] | committer: Andreas Rheinhardt

avformat/segafilmenc: Simplify writing two bytes

Use avio_wb16() instead of avio_write() to write two zero bytes.

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

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

 libavformat/segafilmenc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/segafilmenc.c b/libavformat/segafilmenc.c
index e144da4e68..d935caf00d 100644
--- a/libavformat/segafilmenc.c
+++ b/libavformat/segafilmenc.c
@@ -119,7 +119,6 @@ static int film_write_packet(AVFormatContext *format_context, AVPacket *pkt)
         if (encoded_buf_size != pkt->size && (pkt->size % encoded_buf_size) != 0) {
             avio_write(pb, pkt->data, pkt->size);
         } else {
-            uint8_t padding[2] = {0, 0};
             /* In Sega Cinepak, the reported size in the Cinepak header is
              * 8 bytes too short. However, the size in the STAB section of the header
              * is correct, taking into account the extra two bytes. */
@@ -127,7 +126,7 @@ static int film_write_packet(AVFormatContext *format_context, AVPacket *pkt)
             metadata->size += 2;
 
             avio_write(pb, pkt->data, 10);
-            avio_write(pb, padding, 2);
+            avio_wb16(pb, 0);
             avio_write(pb, &pkt->data[10], pkt->size - 10);
         }
     } else {



More information about the ffmpeg-cvslog mailing list