From 5420523ae3aa379a3274cf715e35ed18efbe6158 Mon Sep 17 00:00:00 2001 From: Marton Balint Date: Sat, 24 Mar 2012 23:34:43 +0100 Subject: pthread: return proper error code on pthread_create failure Signed-off-by: Michael Niedermayer --- libavcodec/pthread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavcodec/pthread.c') diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index e155f73680..e253eb9c36 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -875,7 +875,8 @@ static int frame_thread_init(AVCodecContext *avctx) if (err) goto error; - p->thread_init= !pthread_create(&p->thread, NULL, frame_worker_thread, p); + err = AVERROR(pthread_create(&p->thread, NULL, frame_worker_thread, p)); + p->thread_init= !err; if(!p->thread_init) goto error; } -- cgit v1.2.3