summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-03-26 13:55:30 +0100
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-03-28 23:07:52 +0200
commit46027c7286144294dee565946dccb59f1a8dfeca (patch)
treea4bd06202a3882ae15b59c252c75f0b39ced2283
parent95c8bb03edf5d5c7310947819c4c8691a5e3dfb0 (diff)
downloadffmpeg-streaming-46027c7286144294dee565946dccb59f1a8dfeca.zip
ffmpeg-streaming-46027c7286144294dee565946dccb59f1a8dfeca.tar.gz
Unbreak avcodec_thread_init
avcodec_thread_init currently doesn't do anything at all with pthreads enabled.
-rw-r--r--libavcodec/pthread.c2
-rw-r--r--libavcodec/thread.h2
-rw-r--r--libavcodec/utils.c9
-rw-r--r--libavcodec/w32thread.c3
4 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 658dbac..380edaa 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -880,7 +880,7 @@ static void validate_thread_parameters(AVCodecContext *avctx)
}
}
-int ff_thread_init(AVCodecContext *avctx, int thread_count)
+int ff_thread_init(AVCodecContext *avctx)
{
if (avctx->thread_opaque) {
av_log(avctx, AV_LOG_ERROR, "avcodec_thread_init is ignored after avcodec_open\n");
diff --git a/libavcodec/thread.h b/libavcodec/thread.h
index 485f4ec..9cfb31d 100644
--- a/libavcodec/thread.h
+++ b/libavcodec/thread.h
@@ -108,7 +108,7 @@ int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f);
*/
void ff_thread_release_buffer(AVCodecContext *avctx, AVFrame *f);
-int ff_thread_init(AVCodecContext *s, int thread_count);
+int ff_thread_init(AVCodecContext *s);
void ff_thread_free(AVCodecContext *s);
#endif /* AVCODEC_THREAD_H */
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 2c737d9..42689e0 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -541,7 +541,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;
}
@@ -1193,8 +1193,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
@@ -1337,7 +1336,9 @@ 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;
+ s->thread_type = FF_THREAD_FRAME | FF_THREAD_SLICE;
+ return ff_thread_init(s);
}
void avcodec_thread_free(AVCodecContext *s)
diff --git a/libavcodec/w32thread.c b/libavcodec/w32thread.c
index f2b8f5b..f905077 100644
--- a/libavcodec/w32thread.c
+++ b/libavcodec/w32thread.c
@@ -125,7 +125,7 @@ static int avcodec_thread_execute2(AVCodecContext *s, int (*func)(AVCodecContext
avcodec_thread_execute(s, NULL, arg, ret, count, 0);
}
-int ff_thread_init(AVCodecContext *s, int thread_count){
+int ff_thread_init(AVCodecContext *s){
int i;
ThreadContext *c;
uint32_t threadid;
@@ -135,7 +135,6 @@ int ff_thread_init(AVCodecContext *s, int thread_count){
return 0;
}
- s->thread_count= thread_count;
s->active_thread_type= FF_THREAD_SLICE;
if (thread_count <= 1)
OpenPOWER on IntegriCloud