From abb1aee315f44c03cc3da3627a93651cdd9ca15e Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 3 May 2007 14:44:45 +0000 Subject: Fixed crash in PortAudio's Pa_Util_DebugPrint (pa_debugprint.c - line 102) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1247 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia/pasound.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pjmedia/src') diff --git a/pjmedia/src/pjmedia/pasound.c b/pjmedia/src/pjmedia/pasound.c index 348b189e..27887494 100644 --- a/pjmedia/src/pjmedia/pasound.c +++ b/pjmedia/src/pjmedia/pasound.c @@ -189,6 +189,17 @@ static int PaRecorderPlayerCallback( const void *input, return rc; } +/* Logging callback from PA */ +static void pa_log_cb(const char *log) +{ + PJ_LOG(5,(THIS_FILE, "PA message: %s", log)); +} + +/* We should include pa_debugprint.h for this, but the header + * is not available publicly. :( + */ +typedef void (*PaUtilLogCallback ) (const char *log); +void PaUtil_SetDebugPrintFunction(PaUtilLogCallback cb); /* * Init sound library. @@ -198,6 +209,8 @@ PJ_DEF(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory) if (++snd_init_count == 1) { int err; + PaUtil_SetDebugPrintFunction(&pa_log_cb); + snd_mgr.factory = factory; err = Pa_Initialize(); -- cgit v1.2.3