summaryrefslogtreecommitdiff
path: root/libavformat/au.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/au.c')
-rw-r--r--libavformat/au.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/au.c b/libavformat/au.c
index 788e261e70..bd7838e447 100644
--- a/libavformat/au.c
+++ b/libavformat/au.c
@@ -35,6 +35,8 @@
/* if we don't know the size in advance */
#define AU_UNKNOWN_SIZE ((uint32_t)(~0))
+/* the specification requires an annotation field of at least eight bytes */
+#define AU_HEADER_SIZE (24+8)
/* The libavcodec codecs we support, and the IDs they have in the file */
static const AVCodecTag codec_au_tags[] = {
@@ -56,11 +58,12 @@ static int put_au_header(AVIOContext *pb, AVCodecContext *enc)
if(!enc->codec_tag)
return -1;
ffio_wfourcc(pb, ".snd"); /* magic number */
- avio_wb32(pb, 24); /* header size */
+ avio_wb32(pb, AU_HEADER_SIZE); /* header size */
avio_wb32(pb, AU_UNKNOWN_SIZE); /* data size */
avio_wb32(pb, (uint32_t)enc->codec_tag); /* codec ID */
avio_wb32(pb, enc->sample_rate);
avio_wb32(pb, (uint32_t)enc->channels);
+ avio_wb64(pb, 0); /* annotation field */
return 0;
}
@@ -97,7 +100,7 @@ static int au_write_trailer(AVFormatContext *s)
/* update file size */
file_size = avio_tell(pb);
avio_seek(pb, 8, SEEK_SET);
- avio_wb32(pb, (uint32_t)(file_size - 24));
+ avio_wb32(pb, (uint32_t)(file_size - AU_HEADER_SIZE));
avio_seek(pb, file_size, SEEK_SET);
avio_flush(pb);