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

RESOLVED FIXED in mozilla9

Status

()

Core
Widget: Win32
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: bbondy, Assigned: bbondy)

Tracking

Trunk
mozilla9
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

6 years ago
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.
(Assignee)

Comment 1

6 years ago
Regarding the problem mentioned with Win32's ASYNC flag, please see Bug 498079
(Assignee)

Updated

6 years ago
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
(Assignee)

Comment 2

6 years ago
Created attachment 557078 [details] [diff] [review]
Patch for calling nsISound
Attachment #557078 - Flags: review?(jmathies)

Comment 3

6 years ago
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+
(Assignee)

Comment 4

6 years ago
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?
(Assignee)

Comment 5

6 years ago
Pushed to try:
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=38dc50c1c180
(Assignee)

Comment 6

6 years ago
Jim mentioned that Comment 4 sounded good by the way on irc.
(Assignee)

Comment 7

6 years ago
Pushed to mozilla-inbound:
http://hg.mozilla.org/integration/mozilla-inbound/rev/9401940db9d2
http://hg.mozilla.org/mozilla-central/rev/9401940db9d2
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.