Closed
Bug 176747
Opened 21 years ago
Closed 21 years ago
nsISound::Play(aSoundURL) not working except in one weird case
Categories
(Core :: XUL, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: aaronlev, Assigned: pavlov)
References
Details
I can't add a custom .wav file to typeaheadfind, because nsISound::Play(aSoundURL) is not working. The strange thing is, I can get it to work if I use the debugger, trace into this one line of code and step over it. BOOL PlaySound(const char *aSoundFile,HMODULE aModule,DWORD aOptions) { return (mPlay) ? mPlay(aSoundFile, aModule, aOptions) : FALSE; } If I just let it run normally the sound won't play, either in the debug or release builds.
Reporter | ||
Updated•21 years ago
|
Reporter | ||
Comment 1•21 years ago
|
||
This stinks, I want my custom sound. Someone gimme a clue to what's going on here? Something to do with threads?
Reporter | ||
Comment 2•21 years ago
|
||
Okay, I figured out what was going wrong. I was using: nsCOMPtr<nsISound> soundInterface = do_CreateInstance("@mozilla.org/sound;1"); The problem with this is that nsISound::Play() uses OnStreamComplete() to play the sound, which might not be called before the com pointer goes out of scope, and thus the destructor gets called before the sound has a chance to get played.
Reporter | ||
Comment 3•21 years ago
|
||
The caller just needs to make sure their COMPtr doesn't go out of scope too soon.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•