alsa_stubs.c revision f41e2072ec8320014565f76f4905e47f80b17262
#include <iprt/semaphore.h>
#define LOG_GROUP LOG_GROUP_DEV_AUDIO
#include <alsa/asoundlib.h>
#include "alsa_stubs.h"
#define VBOX_ALSA_LIB "libasound.so.2"
static RTSEMMUTEX mutexAsound;
/**
* Try to dynamically load the ALSA libraries. This function is not
* thread-safe, and should be called before attempting to use any
* of the ALSA functions.
*
* @returns iprt status code
*/
int audioLoadAlsaLib(void)
{
int rc = VINF_SUCCESS;
LogFlowFunc(("\n"));
/* If this is not NO then the function has obviously been called twice,
which is likely to be a bug. */
if (NO != isLibLoaded)
{
}
if (RT_FAILURE(rc))
{
LogFunc(("Failed to create mutex.\n"));
isLibLoaded = FAIL;
}
if (RT_SUCCESS(rc))
{
if (RT_FAILURE(rc))
{
isLibLoaded = FAIL;
}
}
if (RT_SUCCESS(rc))
{
isLibLoaded = YES;
}
return rc;
}
{ \
static int isInitialised = 0; \
int rc; \
\
if (0 != isInitialised) \
{ \
} \
if (RT_SUCCESS(rc)) \
{ \
} \
if (RT_SUCCESS(rc)) \
{ \
} \
return retval; \
} \
(pcm), -1)
PROXY_STUB(snd_pcm_hw_params, int,
PROXY_STUB(snd_pcm_open, int,
(handler), -1)
PROXY_STUB(snd_pcm_sw_params, int,