From df651cf42e0a55339f8f12bec18dd54239d5f224 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sat, 24 Nov 2012 10:38:15 +0100 Subject: Add an annotation field as required by the specification when muxing Sun AU. Reviewed-by: Paul B Mahol --- libavformat/au.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libavformat') 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); -- cgit v1.2.3