History

lavfi/movie: Use filter thread count for decoding threads.

Fixes ticket #7542.

Carl Eugen Hoyos committed 7 years ago

Commit 7ffa4581 parent 61b76761 file · +4 −3Browse files

Unified · Split

libavfilter/src_movie.c+4−3
@@ -153,14 +153,14 @@ static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec) · 152 unmodified lines
153 return found;153 return found;
154}154}
155 155
156static int open_stream(void *log, MovieStream *st)156static int open_stream(AVFilterContext *ctx, MovieStream *st)
157{157{
158 AVCodec *codec;158 AVCodec *codec;
159 int ret;159 int ret;
160 160
161 codec = avcodec_find_decoder(st->st->codecpar->codec_id);161 codec = avcodec_find_decoder(st->st->codecpar->codec_id);
162 if (!codec) {162 if (!codec) {
163 av_log(log, AV_LOG_ERROR, "Failed to find any codec\n");163 av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\n");
164 return AVERROR(EINVAL);164 return AVERROR(EINVAL);
165 }165 }
166 166
@@ -173,9 +173,10 @@ static int open_stream(void *log, MovieStream *st) · 6 unmodified lines
173 return ret;173 return ret;
174 174
175 st->codec_ctx->refcounted_frames = 1;175 st->codec_ctx->refcounted_frames = 1;
176 st->codec_ctx->thread_count = ff_filter_get_nb_threads(ctx);
176 177
177 if ((ret = avcodec_open2(st->codec_ctx, codec, NULL)) < 0) {178 if ((ret = avcodec_open2(st->codec_ctx, codec, NULL)) < 0) {
178 av_log(log, AV_LOG_ERROR, "Failed to open codec\n");179 av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n");
179 return ret;180 return ret;
180 }181 }
181 182

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t