diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-11-12 02:50:25 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-12 02:50:25 +0100 |
commit | 29582df797745fa6c5eec22b007e4fd3a47e7dd9 (patch) | |
tree | 59c487e218e4f750b48151d548db9091236d096f /libavformat/vqf.c | |
parent | 6761b6b825c4aafff311a180a09c7013288480aa (diff) | |
parent | 29ae0565d98bb41e54fc74f74c330d3214825f47 (diff) | |
download | ffmpeg-29582df797745fa6c5eec22b007e4fd3a47e7dd9.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
vble: remove vble_error_close
VBLE Decoder
tta: use an integer instead of a pointer to iterate output samples
shorten: do not modify samples pointer when interleaving
mpc7: only support stereo input.
dpcm: do not try to decode empty packets
dpcm: remove unneeded buf_size==0 check.
twinvq: add SSE/AVX optimized sum/difference stereo interleaving
vqf/twinvq: pass vqf COMM chunk info in extradata
vqf: do not set bits_per_coded_sample for TwinVQ.
twinvq: check for allocation failure in init_mdct_win()
swscale: add padding to conversion buffer.
rtpdec: Simplify finalize_packet
http: Handle proxy authentication
http: Print an error message for Authorization Required, too
AVOptions: don't return an invalid option when option list is empty
AIFF: add 'twos' FourCC for the mux/demuxer (big endian PCM audio)
Conflicts:
libavcodec/avcodec.h
libavcodec/tta.c
libavcodec/vble.c
libavcodec/version.h
libavutil/opt.c
libswscale/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/vqf.c')
-rw-r--r-- | libavformat/vqf.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libavformat/vqf.c b/libavformat/vqf.c index 1530128f4a..b05eb05249 100644 --- a/libavformat/vqf.c +++ b/libavformat/vqf.c @@ -70,6 +70,7 @@ static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap) int header_size; int read_bitrate = 0; int size; + uint8_t comm_chunk[12]; if (!st) return AVERROR(ENOMEM); @@ -100,13 +101,13 @@ static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap) switch(chunk_tag){ case MKTAG('C','O','M','M'): - st->codec->channels = avio_rb32(s->pb) + 1; - read_bitrate = avio_rb32(s->pb); - rate_flag = avio_rb32(s->pb); + avio_read(s->pb, comm_chunk, 12); + st->codec->channels = AV_RB32(comm_chunk ) + 1; + read_bitrate = AV_RB32(comm_chunk + 4); + rate_flag = AV_RB32(comm_chunk + 8); avio_skip(s->pb, len-12); st->codec->bit_rate = read_bitrate*1000; - st->codec->bits_per_coded_sample = 16; break; case MKTAG('N','A','M','E'): add_metadata(s, "title" , len, header_size); @@ -193,6 +194,12 @@ static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap) c->frame_bit_len = st->codec->bit_rate*size/st->codec->sample_rate; av_set_pts_info(st, 64, 1, st->codec->sample_rate); + /* put first 12 bytes of COMM chunk in extradata */ + if (!(st->codec->extradata = av_malloc(12 + FF_INPUT_BUFFER_PADDING_SIZE))) + return AVERROR(ENOMEM); + st->codec->extradata_size = 12; + memcpy(st->codec->extradata, comm_chunk, 12); + return 0; } |