# HG changeset patch # User Wolfgang Rosenauer # Date 1280295362 -7200 # Node ID 22a2c93a47eee574df820e76dabd2ddba427b764 # Parent 2bfb3c461cafe03c8c9acac565a1ee196ff5830a libesd fix (bmo#579877) diff -r 2bfb3c461caf -r 22a2c93a47ee mozilla-esd.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-esd.patch Wed Jul 28 07:36:02 2010 +0200 @@ -0,0 +1,96 @@ +# HG changeset patch +# User Wolfgang Rosenauer +# Parent a93100d87cc9841c6e3e4b29a47bb7b91f23415f +Bug 579877 - sound output via libesd broken if no esound daemon running. r=karlt + +diff --git a/widget/src/gtk2/nsSound.cpp b/widget/src/gtk2/nsSound.cpp +--- a/widget/src/gtk2/nsSound.cpp ++++ b/widget/src/gtk2/nsSound.cpp +@@ -52,36 +52,31 @@ + #include "nsCOMPtr.h" + #include "nsAutoPtr.h" + #include "nsString.h" + + #include + #include + + #include +-/* used with esd_open_sound */ +-static int esdref = -1; + static PRLibrary *elib = nsnull; + static PRLibrary *libcanberra = nsnull; + static PRLibrary* libasound = nsnull; + + // the following from esd.h + + #define ESD_BITS8 (0x0000) + #define ESD_BITS16 (0x0001) + #define ESD_MONO (0x0010) + #define ESD_STEREO (0x0020) + #define ESD_STREAM (0x0000) + #define ESD_PLAY (0x1000) + + #define WAV_MIN_LENGTH 44 + +-typedef int (*EsdOpenSoundType)(const char *host); +-typedef int (*EsdCloseType)(int); +- + /* used to play the sounds from the find symbol call */ + typedef int (*EsdPlayStreamType) (int, int, const char *, const char *); + typedef int (*EsdAudioOpenType) (void); + typedef int (*EsdAudioWriteType) (const void *, int); + typedef void (*EsdAudioCloseType) (void); + + /* used to find and play common system event sounds. + this interfaces with libcanberra. +@@ -126,50 +121,30 @@ NS_IMPL_ISUPPORTS2(nsSound, nsISound, ns + //////////////////////////////////////////////////////////////////////// + nsSound::nsSound() + { + mInited = PR_FALSE; + } + + nsSound::~nsSound() + { +- if (esdref >= 0) { +- EsdCloseType EsdClose = (EsdCloseType) PR_FindFunctionSymbol(elib, "esd_close"); +- if (EsdClose) +- (*EsdClose)(esdref); +- esdref = -1; +- } + } + + NS_IMETHODIMP + nsSound::Init() + { + // This function is designed so that no library is compulsory, and + // one library missing doesn't cause the other(s) to not be used. + if (mInited) + return NS_OK; + + mInited = PR_TRUE; + + if (!elib) { + elib = PR_LoadLibrary("libesd.so.0"); +- if (elib) { +- EsdOpenSoundType EsdOpenSound = +- (EsdOpenSoundType) PR_FindFunctionSymbol(elib, "esd_open_sound"); +- if (!EsdOpenSound) { +- PR_UnloadLibrary(elib); +- elib = nsnull; +- } else { +- esdref = (*EsdOpenSound)("localhost"); +- if (esdref < 0) { +- PR_UnloadLibrary(elib); +- elib = nsnull; +- } +- } +- } + } + + 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; diff -r 2bfb3c461caf -r 22a2c93a47ee mozilla-xulrunner192/mozilla-esd.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mozilla-xulrunner192/mozilla-esd.patch Wed Jul 28 07:36:02 2010 +0200 @@ -0,0 +1,1 @@ +../mozilla-esd.patch \ No newline at end of file diff -r 2bfb3c461caf -r 22a2c93a47ee mozilla-xulrunner192/mozilla-xulrunner192.spec --- a/mozilla-xulrunner192/mozilla-xulrunner192.spec Wed Jul 28 06:57:39 2010 +0200 +++ b/mozilla-xulrunner192/mozilla-xulrunner192.spec Wed Jul 28 07:36:02 2010 +0200 @@ -75,6 +75,7 @@ Patch6: mozilla-helper-app.patch Patch7: mozilla-prefer_plugin_pref.patch Patch8: mozilla-shared-nss-db.patch +Patch9: mozilla-esd.patch Patch10: mozilla-kde.patch # PATCH-FEATURE-SLED FATE#302023, FATE#302024 Patch11: mozilla-gconf-backend.patch @@ -223,6 +224,7 @@ %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 %if %suse_version >= 1110 %patch10 -p1 %endif diff -r 2bfb3c461caf -r 22a2c93a47ee series --- a/series Wed Jul 28 06:57:39 2010 +0200 +++ b/series Wed Jul 28 07:36:02 2010 +0200 @@ -12,6 +12,7 @@ gecko-lockdown.patch toolkit-ui-lockdown.patch mozilla-ua-locale-pref.patch +mozilla-esd.patch # Firefox patches firefox-libxul-sdk.patch