mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-01 22:49:21 +00:00
lavf: force threads to 1 in avformat_find_stream_info()
Fixes avformat_find_stream_info() on streams with number of frames < thread count.
This commit is contained in:
parent
d49352c7cc
commit
93fc5a9ff6
@ -2291,6 +2291,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
|||||||
assert(!st->codec->codec);
|
assert(!st->codec->codec);
|
||||||
codec = avcodec_find_decoder(st->codec->codec_id);
|
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", "1", 0);
|
||||||
|
|
||||||
/* Ensure that subtitle_header is properly set. */
|
/* Ensure that subtitle_header is properly set. */
|
||||||
if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
|
if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE
|
||||||
&& codec && !st->codec->codec)
|
&& codec && !st->codec->codec)
|
||||||
|
Loading…
Reference in New Issue
Block a user