summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-11-24 10:38:15 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-11-24 10:43:11 +0100
commitdf651cf42e0a55339f8f12bec18dd54239d5f224 (patch)
tree945b35d27d6bf37513f77d6eeca8ca1fab3416bc /libavformat
parentf1470ca685026df163c3af9c844231c650472193 (diff)
Add an annotation field as required by the specification when muxing Sun AU.
Reviewed-by: Paul B Mahol
Diffstat (limited to 'libavformat')
-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);