summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorAlexander Strange <astrange@ithinksw.com>2011-03-29 17:18:21 -0400
committerJanne Grunau <janne-libav@jannau.net>2011-04-05 16:53:26 +0200
commitba9ef8d04ecd009036b7c380e71bac081c56c53e (patch)
tree64992160a7850a4be6ce614caa706ae1a6d852e8 /libavcodec/utils.c
parentd6f66edd65992c1275f8e4271be212e1a4808425 (diff)
downloadffmpeg-ba9ef8d04ecd009036b7c380e71bac081c56c53e.tar.gz
Remove unnecessary parameter from ff_thread_init() and fix behavior
thread_count passed to ff_thread_init() is only used to set AVCodecContext. thread_count, and can be removed. Instead move it to the legacy implementation of avcodec_thread_init(). This also fixes the problem that calling avcodec_thread_init() with pthreads enabled did not set it since ff1efc524cb3c60f2f746e3b4550bb1a86c65316. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index bf6baf4e78..12561d0e32 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -539,7 +539,7 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec)
avctx->frame_number = 0;
if (HAVE_THREADS && !avctx->thread_opaque) {
- ret = ff_thread_init(avctx, avctx->thread_count);
+ ret = ff_thread_init(avctx);
if (ret < 0) {
goto free_and_end;
}
@@ -1147,8 +1147,7 @@ int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt) {
#endif
#if !HAVE_THREADS
-int ff_thread_init(AVCodecContext *s, int thread_count){
- s->thread_count = thread_count;
+int ff_thread_init(AVCodecContext *s){
return -1;
}
#endif
@@ -1291,7 +1290,8 @@ void ff_thread_await_progress(AVFrame *f, int progress, int field)
int avcodec_thread_init(AVCodecContext *s, int thread_count)
{
- return ff_thread_init(s, thread_count);
+ s->thread_count = thread_count;
+ return ff_thread_init(s);
}
void avcodec_thread_free(AVCodecContext *s)