aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-15 10:09:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-15 10:35:26 +0200
commitf1ca40ee00402102046fc7e59606651930436b0e (patch)
treed64b21cfabf26f3a2b1a3208745b6cc7e7081a26
parentab94d1be7a32f6d3714935ad5ae551a753024ae6 (diff)
parent1c56cdad337a39951f26b17bdc8068d75a19ffca (diff)
downloadffmpeg-f1ca40ee00402102046fc7e59606651930436b0e.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: riff: Add SVQ3 fourcc fate: ac3: add 4.0 and downmix tests configure: x86: improve ebp availability check vorbisdec: ensure FASTDIV denominator is never 1 avformat: refactor avformat_close_input avformat: simplify avformat_close_input Conflicts: configure libavcodec/vorbisdec.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/vorbisdec.c5
-rw-r--r--libavformat/utils.c14
-rw-r--r--tests/fate/ac3.mak25
3 files changed, 37 insertions, 7 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index d0709331e5..8ce0fc7c83 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1356,8 +1356,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
if (vqbook >= 0 && vc->codebooks[vqbook].codevectors) {
unsigned coffs;
unsigned dim = vc->codebooks[vqbook].dimensions;
- unsigned step = dim == 1 ? vr->partition_size
- : FASTDIV(vr->partition_size, dim);
+ unsigned step = FASTDIV(vr->partition_size << 1, dim << 1);
vorbis_codebook codebook = vc->codebooks[vqbook];
if (vr_type == 0) {
@@ -1411,7 +1410,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
}
} else if (vr_type == 2) {
- unsigned voffs_div = ch == 1 ? voffset : FASTDIV(voffset, ch);
+ unsigned voffs_div = FASTDIV(voffset << 1, ch <<1);
unsigned voffs_mod = voffset - voffs_div * ch;
for (k = 0; k < step; ++k) {
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c6a9e58305..6847091eac 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3058,13 +3058,19 @@ void avformat_close_input(AVFormatContext **ps)
AVFormatContext *s = *ps;
AVIOContext *pb = (s->iformat && (s->iformat->flags & AVFMT_NOFILE)) || (s->flags & AVFMT_FLAG_CUSTOM_IO) ?
NULL : s->pb;
+
flush_packet_queue(s);
- if (s->iformat && (s->iformat->read_close))
- s->iformat->read_close(s);
+
+ if (s->iformat) {
+ if (s->iformat->read_close)
+ s->iformat->read_close(s);
+ }
+
avformat_free_context(s);
+
*ps = NULL;
- if (pb)
- avio_close(pb);
+
+ avio_close(pb);
}
#if FF_API_NEW_STREAM
diff --git a/tests/fate/ac3.mak b/tests/fate/ac3.mak
index 5bbf6785aa..b16687ea4d 100644
--- a/tests/fate/ac3.mak
+++ b/tests/fate/ac3.mak
@@ -3,11 +3,36 @@ fate-ac3-2.0: CMD = pcm -i $(SAMPLES)/ac3/monsters_inc_2.0_192_small.ac3
fate-ac3-2.0: CMP = oneoff
fate-ac3-2.0: REF = $(SAMPLES)/ac3/monsters_inc_2.0_192_small.pcm
+FATE_AC3 += fate-ac3-4.0
+fate-ac3-4.0: CMD = pcm -i $(SAMPLES)/ac3/millers_crossing_4.0.ac3
+fate-ac3-4.0: CMP = oneoff
+fate-ac3-4.0: REF = $(SAMPLES)/ac3/millers_crossing_4.0.pcm
+
+FATE_AC3 += fate-ac3-4.0-downmix-mono
+fate-ac3-4.0-downmix-mono: CMD = pcm -request_channels 1 -i $(SAMPLES)/ac3/millers_crossing_4.0.ac3
+fate-ac3-4.0-downmix-mono: CMP = oneoff
+fate-ac3-4.0-downmix-mono: REF = $(SAMPLES)/ac3/millers_crossing_4.0_mono.pcm
+
+FATE_AC3 += fate-ac3-4.0-downmix-stereo
+fate-ac3-4.0-downmix-stereo: CMD = pcm -request_channels 2 -i $(SAMPLES)/ac3/millers_crossing_4.0.ac3
+fate-ac3-4.0-downmix-stereo: CMP = oneoff
+fate-ac3-4.0-downmix-stereo: REF = $(SAMPLES)/ac3/millers_crossing_4.0_stereo.pcm
+
FATE_AC3 += fate-ac3-5.1
fate-ac3-5.1: CMD = pcm -i $(SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3
fate-ac3-5.1: CMP = oneoff
fate-ac3-5.1: REF = $(SAMPLES)/ac3/monsters_inc_5.1_448_small.pcm
+FATE_AC3 += fate-ac3-5.1-downmix-mono
+fate-ac3-5.1-downmix-mono: CMD = pcm -request_channels 1 -i $(SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3
+fate-ac3-5.1-downmix-mono: CMP = oneoff
+fate-ac3-5.1-downmix-mono: REF = $(SAMPLES)/ac3/monsters_inc_5.1_448_small_mono.pcm
+
+FATE_AC3 += fate-ac3-5.1-downmix-stereo
+fate-ac3-5.1-downmix-stereo: CMD = pcm -request_channels 2 -i $(SAMPLES)/ac3/monsters_inc_5.1_448_small.ac3
+fate-ac3-5.1-downmix-stereo: CMP = oneoff
+fate-ac3-5.1-downmix-stereo: REF = $(SAMPLES)/ac3/monsters_inc_5.1_448_small_stereo.pcm
+
FATE_AC3 += fate-eac3-1
fate-eac3-1: CMD = pcm -i $(SAMPLES)/eac3/csi_miami_5.1_256_spx_small.eac3
fate-eac3-1: CMP = oneoff