Closed Bug 1120247 Opened 10 years ago Closed 10 years ago

MediaCodecReader::ResetDecode() needs to reject(cancel) any pending promises

Categories

(Core :: Audio/Video, defect)

x86_64
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: cpearce, Assigned: bechen)

References

Details

Attachments

(1 file, 1 obsolete file)

I'm pretty sure MediaCodecReader::ResetDecode() should reject(cancel) any pending promises when it runs. I suspect we need to set some sort of threadsafe flag to prevent any running decode tasks from returning output, and then flush decoding, then reject the promises with CANCELED.
Blocks: 1033935
Attached patch bug-1120247.v01.patch (obsolete) — Splinter Review
1. Return cancel by promise in ResetDecode(). 2. In addition, I change the AwaitIdle() to Flush() again because at bug 1114910 comment 7, "Remove self dispatch code" and "Flush() -> AwaiteIdle()" should be done together. But at last, I kept the code of dispatch to self, forgot to change back the Flush() function.
Attachment #8550244 - Flags: review?(cpearce)
Comment on attachment 8550244 [details] [diff] [review] bug-1120247.v01.patch Review of attachment 8550244 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! ::: dom/media/omx/MediaCodecReader.cpp @@ +759,5 @@ > { > if (CheckAudioResources()) { > + mAudioTrack.mTaskQueue->Flush(); > + MonitorAutoLock al(mAudioTrack.mTrackMonitor); > + if(!mAudioTrack.mAudioPromise.IsEmpty()) { Space between "if" and "(", i.e.: if (!mAudioTrack.mAudioPromise.IsEmpty()) Not: if(!mAudioTrack.mAudioPromise.IsEmpty()) @@ +768,5 @@ > } > if (CheckVideoResources()) { > + mVideoTrack.mTaskQueue->Flush(); > + MonitorAutoLock al(mVideoTrack.mTrackMonitor); > + if(!mVideoTrack.mVideoPromise.IsEmpty()) { Space between "if" and "(".
Attachment #8550244 - Flags: review?(cpearce) → review+
Attachment #8550244 - Attachment is obsolete: true
Attachment #8551632 - Flags: review+
Keywords: checkin-needed
bechen, do you know if the debug static analysis build failure related to this change from the try run ?
Flags: needinfo?(bechen)
Keywords: checkin-needed
(In reply to Carsten Book [:Tomcat] from comment #4) > bechen, do you know if the debug static analysis build failure related to > this change from the try run ? From https://treeherder.mozilla.org/#/jobs?repo=try&revision=c19dae66fd51&filter-searchStr=OS%20X%2010.7%2064-bit%20try%20debug%20static%20analysis%20build I don't think it is related to my patch because my patch only works on b2g platform. But at bug 1091467 comment 12, https://treeherder.mozilla.org/#/jobs?repo=try&revision=7c358be71032, It shows the same error. Do you know where I can find out more details like build logs, static analysis logs? Because for now I can only see the logs from comment 3. That doesn't tell me where is the failure of static analysis.
Flags: needinfo?(bechen) → needinfo?(cbook)
Raise checkin-needed again based on comment 5, comment 6.
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Flags: needinfo?(cbook)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: