aboutsummaryrefslogtreecommitdiffstats
path: root/avconv.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2012-01-18 10:53:41 +0100
committerJanne Grunau <janne-libav@jannau.net>2012-01-21 13:26:44 +0100
commit2473a45c85dce6872617b33fce396dbbd6347e8e (patch)
tree771d986fe1409d274578362fae12b3e7fed8c23a /avconv.c
parentafb8b207d6c82bc063ab984b2875074457db2e4f (diff)
downloadffmpeg-2473a45c85dce6872617b33fce396dbbd6347e8e.tar.gz
threads: change the default for threads back to 1
Using threaded decoding by default breaks backward compatibility if AVHWAccel is used or if an appliction sets threadunsafe callbacks. Avconv and avplay still use -threads auto if not specified.
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/avconv.c b/avconv.c
index 008cfe0275..46f3090755 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2210,6 +2210,8 @@ static int init_input_stream(int ist_index, OutputStream *output_streams, int nb
ist->st->codec->opaque = ist;
}
+ if (!av_dict_get(ist->opts, "threads", NULL, 0))
+ av_dict_set(&ist->opts, "threads", "auto", 0);
if (avcodec_open2(ist->st->codec, codec, &ist->opts) < 0) {
snprintf(error, error_len, "Error while opening decoder for input stream #%d:%d",
ist->file_index, ist->st->index);
@@ -2512,6 +2514,8 @@ static int transcode_init(OutputFile *output_files,
memcpy(ost->st->codec->subtitle_header, dec->subtitle_header, dec->subtitle_header_size);
ost->st->codec->subtitle_header_size = dec->subtitle_header_size;
}
+ if (!av_dict_get(ost->opts, "threads", NULL, 0))
+ av_dict_set(&ost->opts, "threads", "auto", 0);
if (avcodec_open2(ost->st->codec, codec, &ost->opts) < 0) {
snprintf(error, sizeof(error), "Error while opening encoder for output stream #%d:%d - maybe incorrect parameters such as bit_rate, rate, width or height",
ost->file_index, ost->index);