b=469635 back out 03b4b372bacc, which had no effect

This commit is contained in:
Karl Tomlinson 2009-02-20 18:41:45 +13:00
parent fa9a21c33d
commit 9f54ec62c0

View File

@ -150,27 +150,6 @@ nsSound::Init()
mInited = PR_TRUE; mInited = PR_TRUE;
if (!libasound) {
PRFuncPtr func = PR_FindFunctionSymbolAndLibrary("snd_lib_error_set_handler",
&libasound);
if (libasound) {
PRFuncPtr lib_err = PR_FindFunctionSymbol(libasound, "snd_lib_error");
PRFuncPtr err_msg = PR_FindFunctionSymbol(libasound, "snd_err_msg");
if (lib_err && err_msg) {
fprintf(stderr, "asound_hack: 1 lib_err %x, err_msg %x\n", *(intptr_t*)lib_err, *(intptr_t*)err_msg);
}
snd_lib_error_set_handler_fn snd_lib_error_set_handler =
(snd_lib_error_set_handler_fn) func;
snd_lib_error_set_handler(quiet_error_handler);
fprintf(stderr, "asound_hack: quiet_error_handler installed");
if (lib_err && err_msg) {
fprintf(stderr, " 2 lib_err %x, err_msg %x", *(intptr_t*)lib_err, *(intptr_t*)err_msg);
}
fprintf(stderr, "\n");
}
}
if (!elib) { if (!elib) {
/* we don't need to do esd_open_sound if we are only going to play files /* we don't need to do esd_open_sound if we are only going to play files
but we will if we want to do things like streams, etc */ but we will if we want to do things like streams, etc */
@ -192,6 +171,16 @@ nsSound::Init()
} }
} }
if (!libasound) {
PRFuncPtr func = PR_FindFunctionSymbolAndLibrary("snd_lib_error_set_handler",
&libasound);
if (libasound) {
snd_lib_error_set_handler_fn snd_lib_error_set_handler =
(snd_lib_error_set_handler_fn) func;
snd_lib_error_set_handler(quiet_error_handler);
}
}
if (!libcanberra) { if (!libcanberra) {
libcanberra = PR_LoadLibrary("libcanberra.so.0"); libcanberra = PR_LoadLibrary("libcanberra.so.0");
if (libcanberra) { if (libcanberra) {
@ -206,15 +195,6 @@ nsSound::Init()
ca_context_change_props = (ca_context_change_props_fn) PR_FindFunctionSymbol(libcanberra, "ca_context_change_props"); ca_context_change_props = (ca_context_change_props_fn) PR_FindFunctionSymbol(libcanberra, "ca_context_change_props");
} }
} }
if (libasound) {
PRFuncPtr lib_err = PR_FindFunctionSymbol(libasound, "snd_lib_error");
PRFuncPtr err_msg = PR_FindFunctionSymbol(libasound, "snd_err_msg");
if (lib_err && err_msg) {
fprintf(stderr, "asound_hack: 3 lib_err %x, err_msg %x, can %p\n", *(intptr_t*)lib_err, *(intptr_t*)err_msg, (void*)libcanberra);
}
}
} }
return NS_OK; return NS_OK;
@ -491,30 +471,12 @@ nsresult nsSound::PlaySystemEventSound(const nsAString &aSoundAlias)
static GStaticPrivate ctx_static_private = G_STATIC_PRIVATE_INIT; static GStaticPrivate ctx_static_private = G_STATIC_PRIVATE_INIT;
ctx = (ca_context*) g_static_private_get(&ctx_static_private); ctx = (ca_context*) g_static_private_get(&ctx_static_private);
if (!ctx) { if (!ctx) {
if (libasound) {
PRFuncPtr lib_err = PR_FindFunctionSymbol(libasound, "snd_lib_error");
PRFuncPtr err_msg = PR_FindFunctionSymbol(libasound, "snd_err_msg");
if (lib_err && err_msg) {
fprintf(stderr, "asound_hack: 4 lib_err %x, err_msg %x\n", *(intptr_t*)lib_err, *(intptr_t*)err_msg);
}
}
ca_context_create(&ctx); ca_context_create(&ctx);
if (!ctx) { if (!ctx) {
g_free(sound_theme_name); g_free(sound_theme_name);
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }
if (libasound) {
PRFuncPtr lib_err = PR_FindFunctionSymbol(libasound, "snd_lib_error");
PRFuncPtr err_msg = PR_FindFunctionSymbol(libasound, "snd_err_msg");
if (lib_err && err_msg) {
fprintf(stderr, "asound_hack: 5 lib_err %x, err_msg %x\n", *(intptr_t*)lib_err, *(intptr_t*)err_msg);
}
}
g_static_private_set(&ctx_static_private, ctx, (GDestroyNotify) ca_context_destroy); g_static_private_set(&ctx_static_private, ctx, (GDestroyNotify) ca_context_destroy);
} }