summaryrefslogtreecommitdiff
path: root/libavfilter/lavfutils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-04-30 03:03:31 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-30 03:48:33 +0200
commitd2184bf3b65354e44c177e226a6c59c5d6fdbad4 (patch)
tree27a9f04f28fada4c2221a7974d4d0851c60b6031 /libavfilter/lavfutils.c
parent2025e803cd0c865b6ca2f80160293de28eb5efed (diff)
avfilter/lavfutils: disable frame threads when decoding a single image
The image decoding code does expect the image to be decoded immedeatly Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/lavfutils.c')
-rw-r--r--libavfilter/lavfutils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c
index 75e68a7d06..9952e6eab6 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);