aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-19 02:11:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-19 02:34:18 +0100
commit7c29313b387392fa305365e855fa408cd28c276e (patch)
tree328f30ad4a4e6b606bbbffc1f15f22d2044affb3 /libavformat/utils.c
parentf371396dfb95c116a05e9b9f690fa916bb2d815e (diff)
parent2a216ca2ef29282cac9003a716b469b8c80c0a15 (diff)
downloadffmpeg-7c29313b387392fa305365e855fa408cd28c276e.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: APIchanges: fill in revision for AVFrame.age deprecation avcodec: deprecate AVFrame.age 4xm: remove unneeded check for remaining unused data. lavf: force threads to 1 in avformat_find_stream_info() swscale: fix overflows in vertical scaling at top/bottom edges. lavf: add OpenMG audio muxer. omadec: split data that will be used in the muxer to a separate file. lavf: rename oma.c -> omadec.c tmv decoder: set correct pix_fmt Conflicts: Changelog doc/APIchanges libavcodec/mpegvideo.c libavcodec/version.h libavformat/oma.c libavformat/version.h libswscale/swscale.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 76c4bf7e78..f0df759bf5 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2393,6 +2393,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
assert(!st->codec->codec);
codec = avcodec_find_decoder(st->codec->codec_id);
+ /* this function doesn't flush the decoders, so force thread count
+ * to 1 to fix behavior when thread count > number of frames in the file */
+ if (options)
+ av_dict_set(&options[i], "threads", 0, 0);
+
/* Ensure that subtitle_header is properly set. */
if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
&& codec && !st->codec->codec)
@@ -2400,15 +2405,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
//try to just open decoders, in case this is enough to get parameters
if(!has_codec_parameters(st->codec)){
- if (codec && !st->codec->codec){
- AVDictionary *tmp = NULL;
- if (options){
- av_dict_copy(&tmp, options[i], 0);
- av_dict_set(&tmp, "threads", 0, 0);
- }
- avcodec_open2(st->codec, codec, options ? &tmp : NULL);
- av_dict_free(&tmp);
- }
+ if (codec && !st->codec->codec)
+ avcodec_open2(st->codec, codec, options ? &options[i] : NULL);
}
}