diff options
Diffstat (limited to 'compat/w32pthreads.h')
-rw-r--r-- | compat/w32pthreads.h | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h index be275ed..cfb8f64 100644 --- a/compat/w32pthreads.h +++ b/compat/w32pthreads.h @@ -4,20 +4,20 @@ * Authors: Steven Walters <kemuri9@gmail.com> * Pegasys Inc. <http://www.pegasys-inc.com> * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -26,8 +26,8 @@ * w32threads to pthreads wrapper */ -#ifndef LIBAV_COMPAT_W32PTHREADS_H -#define LIBAV_COMPAT_W32PTHREADS_H +#ifndef FFMPEG_COMPAT_W32PTHREADS_H +#define FFMPEG_COMPAT_W32PTHREADS_H /* Build up a pthread-like API using underlying Windows API. Have only static * methods so as to not conflict with a potentially linked in pthread-win32 @@ -39,6 +39,7 @@ #include <windows.h> #include <process.h> +#include "libavutil/common.h" #include "libavutil/internal.h" #include "libavutil/mem.h" @@ -133,28 +134,29 @@ typedef struct win32_cond_t { volatile int is_broadcast; } win32_cond_t; -static void pthread_cond_init(pthread_cond_t *cond, const void *unused_attr) +static int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr) { win32_cond_t *win32_cond = NULL; if (cond_init) { cond_init(cond); - return; + return 0; } /* non native condition variables */ win32_cond = av_mallocz(sizeof(win32_cond_t)); if (!win32_cond) - return; + return ENOMEM; cond->ptr = win32_cond; win32_cond->semaphore = CreateSemaphore(NULL, 0, 0x7fffffff, NULL); if (!win32_cond->semaphore) - return; + return ENOMEM; win32_cond->waiters_done = CreateEvent(NULL, TRUE, FALSE, NULL); if (!win32_cond->waiters_done) - return; + return ENOMEM; pthread_mutex_init(&win32_cond->mtx_waiter_count, NULL); pthread_mutex_init(&win32_cond->mtx_broadcast, NULL); + return 0; } static void pthread_cond_destroy(pthread_cond_t *cond) @@ -278,4 +280,4 @@ static void w32thread_init(void) } -#endif /* LIBAV_COMPAT_W32PTHREADS_H */ +#endif /* FFMPEG_COMPAT_W32PTHREADS_H */ |