Fixes ticket #7542.
Unified · Split
| @@ -153,14 +153,14 @@ static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec) · 152 unmodified lines | ||
| 153 | 153 | return found; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | −static int open_stream(void *log, MovieStream *st) | |
| 156 | +static int open_stream(AVFilterContext *ctx, MovieStream *st) | |
| 157 | 157 | { |
| 158 | 158 | AVCodec *codec; |
| 159 | 159 | int ret; |
| 160 | 160 | |
| 161 | 161 | codec = avcodec_find_decoder(st->st->codecpar->codec_id); |
| 162 | 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 | 164 | return AVERROR(EINVAL); |
| 165 | 165 | } |
| 166 | 166 | |
| @@ -173,9 +173,10 @@ static int open_stream(void *log, MovieStream *st) · 6 unmodified lines | ||
| 173 | 173 | return ret; |
| 174 | 174 | |
| 175 | 175 | st->codec_ctx->refcounted_frames = 1; |
| 176 | + st->codec_ctx->thread_count = ff_filter_get_nb_threads(ctx); | |
| 176 | 177 | |
| 177 | 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 | 180 | return ret; |
| 180 | 181 | } |
| 181 | 182 | |