mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-09 16:50:01 +00:00
lavfi/movie: Use filter thread count for decoding threads.
Fixes ticket #7542.
This commit is contained in:
parent
61b7676bd5
commit
7ffa458d60
@ -153,14 +153,14 @@ static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec)
|
|||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int open_stream(void *log, MovieStream *st)
|
static int open_stream(AVFilterContext *ctx, MovieStream *st)
|
||||||
{
|
{
|
||||||
AVCodec *codec;
|
AVCodec *codec;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
codec = avcodec_find_decoder(st->st->codecpar->codec_id);
|
codec = avcodec_find_decoder(st->st->codecpar->codec_id);
|
||||||
if (!codec) {
|
if (!codec) {
|
||||||
av_log(log, AV_LOG_ERROR, "Failed to find any codec\n");
|
av_log(ctx, AV_LOG_ERROR, "Failed to find any codec\n");
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,9 +173,10 @@ static int open_stream(void *log, MovieStream *st)
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
st->codec_ctx->refcounted_frames = 1;
|
st->codec_ctx->refcounted_frames = 1;
|
||||||
|
st->codec_ctx->thread_count = ff_filter_get_nb_threads(ctx);
|
||||||
|
|
||||||
if ((ret = avcodec_open2(st->codec_ctx, codec, NULL)) < 0) {
|
if ((ret = avcodec_open2(st->codec_ctx, codec, NULL)) < 0) {
|
||||||
av_log(log, AV_LOG_ERROR, "Failed to open codec\n");
|
av_log(ctx, AV_LOG_ERROR, "Failed to open codec\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user