Closed Bug 683188 Opened 10 years ago Closed 10 years ago
ISound should be used in Win32 widget code, not Play Sound directly
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
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.
Pushed to mozilla-inbound: http://hg.mozilla.org/integration/mozilla-inbound/rev/9401940db9d2
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.