Closed Bug 683188 Opened 8 years ago Closed 8 years ago

nsISound should be used in Win32 widget code, not PlaySound directly

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: bbondy, Assigned: bbondy)

Details

Attachments

(1 file)

We are currently calling PlaySound directly in widget/src/wimndows/nsWindow.cpp here:

http://mxr.mozilla.org/mozilla-central/source/widget/src/windows/nsWindow.cpp#6140

The problem with this is that Win32's ASYNC flag isn't exactly async. This may slow down or seem to temporarily hang some computers that minimize.  Instead we should be using nsISound which has support for this via threading.
Regarding the problem mentioned with Win32's ASYNC flag, please see Bug 498079
Summary: PlaySound should not be used directly in Win32 widget code, nsISound should be used instead → nsISound should be used in Win32 widget code, not PlaySound directly
Attachment #557078 - Flags: review?(jmathies)
Comment on attachment 557078 [details] [diff] [review]
Patch for calling nsISound

We should probably cache sound so we only have to create it once.
Attachment #557078 - Flags: review?(jmathies) → review+
We are currently doing that everywhere we play sound. 
Bug 683184 will address this by making it a service. 
So is it OK as is until Bug 683184?
Jim mentioned that Comment 4 sounded good by the way on irc.
http://hg.mozilla.org/mozilla-central/rev/9401940db9d2
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.