aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
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 /libavformat
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c14
1 files changed, 10 insertions, 4 deletions
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