Closed
Bug 1419378
Opened 8 years ago
Closed 8 years ago
Return failure in AudioCallbackDriver::Init when out channels is 0
Categories
(Core :: Audio/Video: MediaStreamGraph, enhancement, P3)
Core
Audio/Video: MediaStreamGraph
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: achronop, Assigned: achronop)
Details
Attachments
(1 file)
In AudioCallbackDriver the mOutputChannels are set during during Init() method. The value is queried from MSG corresponding method which can return 0. Right now we hide the error by resetting to 1 when we get a 0 [1]. This is wrong, it would be better to return error instead of resetting the value.
[1] https://searchfox.org/mozilla-central/source/dom/media/GraphDriver.cpp#618
Assignee | ||
Updated•8 years ago
|
Rank: 25
Priority: -- → P3
Comment hidden (mozreview-request) |
Assignee | ||
Comment 2•8 years ago
|
||
Comment 3•8 years ago
|
||
mozreview-review |
Comment on attachment 8930449 [details]
Bug 1419378 - Fail before stream init when output number of channels is zero.
https://reviewboard.mozilla.org/r/201602/#review207892
::: dom/media/GraphDriver.cpp:622
(Diff revision 1)
> // Query and set the number of channels this AudioCallbackDriver will use.
> - mOutputChannels = std::max<uint32_t>(1, mGraphImpl->AudioChannelCount());
> + mOutputChannels = mGraphImpl->AudioChannelCount();
> + if (!mOutputChannels) {
> + LOG(LogLevel::Warning, ("Output number of channels is 0."));
> + return false;
> + }
How is that better? Have you tested that this changes things?
I think you should do something like: https://searchfox.org/mozilla-central/source/dom/media/GraphDriver.cpp#693
Attachment #8930449 -
Flags: review?(padenot) → review-
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → achronop
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•8 years ago
|
||
mozreview-review |
Comment on attachment 8930449 [details]
Bug 1419378 - Fail before stream init when output number of channels is zero.
https://reviewboard.mozilla.org/r/201602/#review208184
::: dom/media/GraphDriver.cpp:622
(Diff revision 1)
> // Query and set the number of channels this AudioCallbackDriver will use.
> - mOutputChannels = std::max<uint32_t>(1, mGraphImpl->AudioChannelCount());
> + mOutputChannels = mGraphImpl->AudioChannelCount();
> + if (!mOutputChannels) {
> + LOG(LogLevel::Warning, ("Output number of channels is 0."));
> + return false;
> + }
It is better because we do attempt to open a device that reported zero number of channels. Right now we arbitary use mono in that case.
Added the fallback to SystemClockDriver which creates an infinite loop of retries. I am not sure how useful it is to retry with zero number of channels. Is there a better way to report that error?
Comment 6•8 years ago
|
||
Well, maybe a device will be plugged in?
Comment 7•8 years ago
|
||
mozreview-review |
Comment on attachment 8930449 [details]
Bug 1419378 - Fail before stream init when output number of channels is zero.
https://reviewboard.mozilla.org/r/201602/#review208858
Attachment #8930449 -
Flags: review?(padenot) → review+
Pushed by achronop@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/e114b48a4e78
Fail before stream init when output number of channels is zero. r=padenot
Comment 9•8 years ago
|
||
Backed out for merge conflict.
https://hg.mozilla.org/integration/autoland/rev/fefa8c2175a5b969b25757473d9213a83a84b800
Flags: needinfo?(achronop)
Comment hidden (mozreview-request) |
Comment 11•8 years ago
|
||
Pushed by achronop@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/bde36d0fa2eb
Fail before stream init when output number of channels is zero. r=padenot
Comment 13•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Comment 14•8 years ago
|
||
bugherder landing |
You need to log in
before you can comment on or make changes to this bug.
Description
•