X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Flavfutils.c;h=9952e6eab6f969d3d03dce3525e587a252cbfac5;hb=ce1c0e99e9f66616bcbdbc2de8ca077bdfa03aa7;hp=75e68a7d06278029497d74a773de5ba089094709;hpb=1a41415b2adcc38d1de4b10ed2f97c2db2036c08;p=ffmpeg diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c index 75e68a7d062..9952e6eab6f 100644 --- a/libavfilter/lavfutils.c +++ b/libavfilter/lavfutils.c @@ -32,6 +32,7 @@ int ff_load_image(uint8_t *data[4], int linesize[4], AVFrame *frame; int frame_decoded, ret = 0; AVPacket pkt; + AVDictionary *opt=NULL; av_init_packet(&pkt); @@ -57,7 +58,8 @@ int ff_load_image(uint8_t *data[4], int linesize[4], goto end; } - if ((ret = avcodec_open2(codec_ctx, codec, NULL)) < 0) { + av_dict_set(&opt, "thread_type", "slice", 0); + if ((ret = avcodec_open2(codec_ctx, codec, &opt)) < 0) { av_log(log_ctx, AV_LOG_ERROR, "Failed to open codec\n"); goto end; } @@ -97,6 +99,7 @@ end: avcodec_close(codec_ctx); avformat_close_input(&format_ctx); av_frame_free(&frame); + av_dict_free(&opt); if (ret < 0) av_log(log_ctx, AV_LOG_ERROR, "Error loading image file '%s'\n", filename);