From e757d71ff393d9a351b753c0e93e1dbfabb35eb9 Mon Sep 17 00:00:00 2001 From: todd Date: Wed, 18 Jun 2008 21:16:39 +0000 Subject: [PATCH] initialize the semaphore prior to code that might terminate early considering pjsua destroys the semaphore unconditionally found through exercising new codepaths on macppc ok deanna@ --- ...ty_portaudio_src_hostapi_oss_pa_unix_oss_c | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/telephony/pjsua/patches/patch-third_party_portaudio_src_hostapi_oss_pa_unix_oss_c b/telephony/pjsua/patches/patch-third_party_portaudio_src_hostapi_oss_pa_unix_oss_c index 48c6c0859f3..fc8004b1daa 100644 --- a/telephony/pjsua/patches/patch-third_party_portaudio_src_hostapi_oss_pa_unix_oss_c +++ b/telephony/pjsua/patches/patch-third_party_portaudio_src_hostapi_oss_pa_unix_oss_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-third_party_portaudio_src_hostapi_oss_pa_unix_oss_c,v 1.2 2007/10/27 16:33:02 sthen Exp $ ---- third_party/portaudio/src/hostapi/oss/pa_unix_oss.c.orig Sun Mar 25 22:20:31 2007 -+++ third_party/portaudio/src/hostapi/oss/pa_unix_oss.c Sat Oct 27 14:30:30 2007 +$OpenBSD: patch-third_party_portaudio_src_hostapi_oss_pa_unix_oss_c,v 1.3 2008/06/18 21:16:39 todd Exp $ +--- third_party/portaudio/src/hostapi/oss/pa_unix_oss.c.orig Sun Mar 25 15:20:31 2007 ++++ third_party/portaudio/src/hostapi/oss/pa_unix_oss.c Wed Jun 18 14:37:03 2008 @@ -8,6 +8,8 @@ * Dominic Mazzoni * Arve Knudsen @@ -131,6 +131,22 @@ $OpenBSD: patch-third_party_portaudio_src_hostapi_oss_pa_unix_oss_c,v 1.2 2007/1 } else { +@@ -848,6 +849,7 @@ static PaError PaOssStream_Initialize( PaOssStream *st + memset( stream, 0, sizeof (PaOssStream) ); + stream->isStopped = 1; + ++ ENSURE_( sem_init( &stream->semaphore, 0, 0 ), paInternalError ); + PA_ENSURE( PaUtil_InitializeThreading( &stream->threading ) ); + + if( inputParameters && outputParameters ) +@@ -884,7 +886,6 @@ static PaError PaOssStream_Initialize( PaOssStream *st + &ossApi->blockingStreamInterface, callback, userData ); + } + +- ENSURE_( sem_init( &stream->semaphore, 0, 0 ), paInternalError ); + + error: + return result; @@ -975,8 +976,8 @@ static int CalcHigherLogTwo( int n ) return log2; }