diff --git a/widget/src/gtk2/nsSound.cpp b/widget/src/gtk2/nsSound.cpp index 69ff32e..1bdefcd 100644 --- a/widget/src/gtk2/nsSound.cpp +++ b/widget/src/gtk2/nsSound.cpp @@ -88,6 +88,7 @@ typedef void (*EsdAudioCloseType) (void); */ typedef struct _ca_context ca_context; +typedef int (*ca_context_set_driver_fn) (ca_context *, const char *); typedef int (*ca_context_create_fn) (ca_context **); typedef int (*ca_context_destroy_fn) (ca_context *); typedef int (*ca_context_play_fn) (ca_context *c, @@ -96,6 +97,7 @@ typedef int (*ca_context_play_fn) (ca_context *c, typedef int (*ca_context_change_props_fn) (ca_context *c, ...); +static ca_context_set_driver_fn ca_context_set_driver; static ca_context_create_fn ca_context_create; static ca_context_destroy_fn ca_context_destroy; static ca_context_play_fn ca_context_play; @@ -186,6 +188,7 @@ nsSound::Init() libcanberra = nsnull; } else { // at this point we know we have a good libcanberra library + ca_context_set_driver = (ca_context_set_driver_fn) PR_FindFunctionSymbol(libcanberra, "ca_context_set_driver"); ca_context_destroy = (ca_context_destroy_fn) PR_FindFunctionSymbol(libcanberra, "ca_context_destroy"); ca_context_play = (ca_context_play_fn) PR_FindFunctionSymbol(libcanberra, "ca_context_play"); ca_context_change_props = (ca_context_change_props_fn) PR_FindFunctionSymbol(libcanberra, "ca_context_change_props"); @@ -476,6 +479,9 @@ NS_IMETHODIMP nsSound::PlayEventSound(PRUint32 aEventId) return NS_ERROR_OUT_OF_MEMORY; } + + ca_context_set_driver(ctx, "alsa"); + g_static_private_set(&ctx_static_private, ctx, (GDestroyNotify) ca_context_destroy); }