Closed
Bug 1174721
Opened 9 years ago
Closed 9 years ago
[FFOS] Use AudioCompactor for mp3 in Gonk PDM
Categories
(Core :: Audio/Video: Playback, defect)
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: bwu, Assigned: bechen)
Details
Attachments
(1 file)
We should use AudioCompactor in Gonk PDM to save memory as bug 960873.
MediaCodecReader and MediaOmxReader use it as well.
Updated•9 years ago
|
Component: Audio/Video → Audio/Video: Playback
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → bechen
Assignee | ||
Comment 1•9 years ago
|
||
Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager.
Attachment #8665886 -
Flags: review?(sotaro.ikeda.g)
Comment 2•9 years ago
|
||
Comment on attachment 8665886 [details]
MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
https://reviewboard.mozilla.org/r/20371/#review18411
::: dom/media/platforms/gonk/GonkAudioDecoderManager.cpp:119
(Diff revision 1)
> - return NS_ERROR_UNEXPECTED;
> + return;
Is there a reason to remove NS_ERROR_UNEXPECTED error handling?
Attachment #8665886 -
Flags: review?(sotaro.ikeda.g)
Assignee | ||
Comment 3•9 years ago
|
||
Comment on attachment 8665886 [details]
MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager.
Attachment #8665886 -
Flags: review?(sotaro.ikeda.g)
Assignee | ||
Updated•9 years ago
|
Attachment #8665886 -
Flags: review?(sotaro.ikeda.g)
Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8665886 [details]
MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
Attachment #8665886 -
Attachment description: MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. → MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
Attachment #8665886 -
Flags: review?(sotaro.ikeda.g)
Assignee | ||
Comment 5•9 years ago
|
||
https://reviewboard.mozilla.org/r/20371/#review18411
> Is there a reason to remove NS_ERROR_UNEXPECTED error handling?
Last week, I only consider the NS_OK and NS_ERROR_NOT_AVAILABLE cases, forgot the NS_ERROR_UNEXPECTED.
I will change back the |CreateAudioData| to return nsresult.
Assignee | ||
Comment 6•9 years ago
|
||
https://reviewboard.mozilla.org/r/20371/#review18411
Using AudioCompactor needs an AudioQueue inside, so we need to clear the AudioQueue when flushing.
And also the AudioCompactor will divide one audio sample into multiples, so we need to handle the EOS properly.
Comment 7•9 years ago
|
||
Comment on attachment 8665886 [details]
MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
https://reviewboard.mozilla.org/r/20371/#review19785
Sorry for the delay. I am back from PTO. As the following comment, the code seems to have a change to leak MediaBuffer. Dont't we need to address it?
::: dom/media/platforms/gonk/GonkAudioDecoderManager.cpp:174
(Diff revision 3)
> err = mDecoder->Output(&mAudioBuffer, READ_OUTPUT_BUFFER_TIMEOUT_US);
If there is a case that mAudioBuffer is not null when mDecoder->Output(&mAudioBuffer, ...) is called, it seems to leak MediaBuffer. MediaBuffer needs manual reference count change to release it. It is like in MediaCodecProxy::ReleaseMediaBuffer().
Attachment #8665886 -
Flags: review?(sotaro.ikeda.g)
Comment 8•9 years ago
|
||
(In reply to Sotaro Ikeda [:sotaro] from comment #7)
> As the following comment, the code
> seems to have a change to leak MediaBuffer.
Correction:
have a chance to leak MediaBuffer.
Assignee | ||
Comment 9•9 years ago
|
||
Comment on attachment 8665886 [details]
MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
Attachment #8665886 -
Flags: review?(sotaro.ikeda.g)
Assignee | ||
Comment 10•9 years ago
|
||
https://reviewboard.mozilla.org/r/20371/#review19785
> If there is a case that mAudioBuffer is not null when mDecoder->Output(&mAudioBuffer, ...) is called, it seems to leak MediaBuffer. MediaBuffer needs manual reference count change to release it. It is like in MediaCodecProxy::ReleaseMediaBuffer().
Although I didn't run into the leak case, I think it is better to prevent it.
And since the GonkAudioDecoderManager::Output has many |return| |break| ...
I'm going make |mAudioBuffer| into a local variable, and create a new class for auto release audiobuffer at the end of GonkAudioDecoderManager::Output.
Comment 11•9 years ago
|
||
Comment on attachment 8665886 [details]
MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
https://reviewboard.mozilla.org/r/20371/#review19971
Thanks for updating the patch! In previous patch, we could not know whether the code cause a memory leak. Current pach looks safer :)
Attachment #8665886 -
Flags: review?(sotaro.ikeda.g) → review+
Assignee | ||
Comment 12•9 years ago
|
||
Keywords: checkin-needed
Comment 13•9 years ago
|
||
Hello, this doesn't apply anymore. Could you please refresh the patch? Please add checkin-needed back again when the patch is refreshed.
Flags: needinfo?(bechen)
Keywords: checkin-needed
Assignee | ||
Comment 14•9 years ago
|
||
Comment on attachment 8665886 [details]
MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
Attachment #8665886 -
Flags: review+ → review?(sotaro.ikeda.g)
Assignee | ||
Comment 15•9 years ago
|
||
Comment on attachment 8665886 [details]
MozReview Request: Bug 1174721: Use AudioCompactor for GonkAudioDecoderManager. r=sotaro
https://reviewboard.mozilla.org/r/20371/#review20245
Attachment #8665886 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(bechen)
Attachment #8665886 -
Flags: review?(sotaro.ikeda.g)
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 16•9 years ago
|
||
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•