summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-01-21 23:23:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-21 23:23:23 +0100
commitc5c7e0ebc10054d8ce813b46065f1a406b65aece (patch)
tree0af2b8a21a3423b180195643a0cc9ad09f8d19e6 /ffmpeg.c
parentb5a69e79c579e6e15e2019ffd34ef0e09aeab586 (diff)
git show 2473a45c85dce6872617b33fce396dbbd6347e8e avconv.c | patch ffmpeg.c
Original commit: commit 2473a45c85dce6872617b33fce396dbbd6347e8e Author: Janne Grunau <janne-libav@jannau.net> Date: Wed Jan 18 10:53:41 2012 +0100 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. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 6be1fcba0d..f7da14c8c4 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2360,6 +2360,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);
@@ -2685,6 +2687,8 @@ static int transcode_init(OutputFile *output_files, int nb_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);