diff mbox series

[FFmpeg-devel,3/3] avformat/aiffenc: Usw avio_wb32() where possible

Message ID AS8P250MB0744D305771E72FB885DC0058F292@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 95a6788314a2f5080e8d5488dd5ba1040abeba6f
Headers show
Series [FFmpeg-devel,1/3] fate/lavf-audio: Test writing AIFF-native tags | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Andreas Rheinhardt March 14, 2024, 12:36 a.m. UTC
AIFF is a big-endian format, so this is more natural.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/aiffenc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index 37aca41847..2cd1119409 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -54,7 +54,7 @@  static int put_id3v2_tags(AVFormatContext *s, AIFFOutputContext *aiff)
     if (!s->metadata && !s->nb_chapters && !list_entry)
         return 0;
 
-    avio_wl32(pb, MKTAG('I', 'D', '3', ' '));
+    avio_wb32(pb, MKBETAG('I', 'D', '3', ' '));
     avio_wb32(pb, 0);
     pos = avio_tell(pb);
 
@@ -93,7 +93,7 @@  static void put_meta(AVFormatContext *s, const char *key, uint32_t id)
         // So simply copy the terminating \0 if the length is odd.
         size = FFALIGN(size, 2);
 
-        avio_wl32(pb, id);
+        avio_wb32(pb, id);
         avio_wb32(pb, size);
         avio_write(pb, tag->value, size);
     }
@@ -153,10 +153,10 @@  static int aiff_write_header(AVFormatContext *s)
         ff_mov_write_chan(pb, par->ch_layout.u.mask);
     }
 
-    put_meta(s, "title",     MKTAG('N', 'A', 'M', 'E'));
-    put_meta(s, "author",    MKTAG('A', 'U', 'T', 'H'));
-    put_meta(s, "copyright", MKTAG('(', 'c', ')', ' '));
-    put_meta(s, "comment",   MKTAG('A', 'N', 'N', 'O'));
+    put_meta(s, "title",     MKBETAG('N', 'A', 'M', 'E'));
+    put_meta(s, "author",    MKBETAG('A', 'U', 'T', 'H'));
+    put_meta(s, "copyright", MKBETAG('(', 'c', ')', ' '));
+    put_meta(s, "comment",   MKBETAG('A', 'N', 'N', 'O'));
 
     /* Common chunk */
     ffio_wfourcc(pb, "COMM");