diff --git a/mozilla/widget/src/mac/nsSound.cpp b/mozilla/widget/src/mac/nsSound.cpp index 4333e993112..34b97dd59d3 100644 --- a/mozilla/widget/src/mac/nsSound.cpp +++ b/mozilla/widget/src/mac/nsSound.cpp @@ -30,6 +30,8 @@ #include "nsNetUtil.h" #include "prmem.h" +#include +#include #include NS_IMPL_ISUPPORTS(nsSound, NS_GET_IID(nsISound)); @@ -76,6 +78,10 @@ NS_METHOD nsSound::Beep() // this currently does no cacheing of the sound buffer. It should NS_METHOD nsSound::Play(nsIURI *aURI) { + // if quicktime is not installed, we can't do anything + if (!HaveQuickTime()) + return NS_ERROR_NOT_IMPLEMENTED; + #if !TARGET_CARBON nsresult rv; nsCOMPtr inputStream; @@ -201,3 +207,11 @@ bail: // gasp, a goto label return NS_OK; #endif } + + +PRBool nsSound::HaveQuickTime() +{ + long gestResult; + OSErr err = Gestalt (gestaltQuickTime, &gestResult); + return (err == noErr) && ((long)EnterMovies != kUnresolvedCFragSymbolAddress); +} diff --git a/mozilla/widget/src/mac/nsSound.h b/mozilla/widget/src/mac/nsSound.h index c914a8cd4ed..cc34d57f2c1 100644 --- a/mozilla/widget/src/mac/nsSound.h +++ b/mozilla/widget/src/mac/nsSound.h @@ -25,8 +25,6 @@ #include "nsISound.h" -#include - class nsSound : public nsISound { public: @@ -41,6 +39,7 @@ public: protected: nsresult PlaySound(Handle waveDataHandle, long waveDataSize); + PRBool HaveQuickTime(); };