Closed Bug 1295906 Opened 9 years ago Closed 9 years ago

Move |mVideoFrameContainer->ClearCurrentFrame()| out of MediaFormatReader::ReleaseResources()

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla51
Tracking Status
firefox51 --- fixed

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(1 file, 1 obsolete file)

VideoFrameContainer should be a concern of playback (MDSM/VideoSink) instead of a reader/decoder. I will add a MediaSink::ClearVideoFrames() function to do the job. By doing so, we allow MDSM to enter dormant state more aggressively without making noticeable effects to the user: 1. Enter dormant state when playback reaches the end to reclaim memory and hardware resources. Note we can't clear video frames which is visible to the user. 2. Enter dormant state when playback is paused for a certain amount of time to reclaim memory and hardware resources. Note we can't clear video frames which is visible to the user. 3. Enter dormant state when the document becomes inactive. Note we can clear video frames which is not visible to the user.
Assignee: nobody → jwwang
Blocks: 1286129
Priority: -- → P3
Since MDSM also holds a VideoFrameContainer, I will move the call to ClearCurrentFrame() to MediaDecoderStateMachine::FinishShutdown().
Bug 1295901 has changed the function name.
Summary: Move |mVideoFrameContainer->ClearCurrentFrame()| out of MediaFormatReader::ReleaseMediaResources() → Move |mVideoFrameContainer->ClearCurrentFrame()| out of MediaFormatReader::ReleaseResources()
Attachment #8782212 - Flags: review?(jyavenard)
Comment on attachment 8782212 [details] Bug 1295906 - Move |mVideoFrameContainer->ClearCurrentFrame()| out of MediaFormatReader::ReleaseResources(). https://reviewboard.mozilla.org/r/72422/#review70896
Attachment #8782212 - Flags: review?(jyavenard) → review+
Thanks!
Pushed by jwwang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d6d2cc94bb92 Move |mVideoFrameContainer->ClearCurrentFrame()| out of MediaFormatReader::ReleaseResources(). r=jya
Sorry had to back this out for M-e10s crashes on Windows 7 debug, e.g., https://treeherder.mozilla.org/logviewer.html#?job_id=2364187&repo=autoland#L3321
Flags: needinfo?(jwwang)
Backout by ihsiao@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/35416a1541ae Backed out changeset d6d2cc94bb92 for M-e10s crashes on Windows 7 debug
It is interesting that MediaFormatReader::Shutdown() clears |mVideoFrameContainer| [1] before calling MediaDecoderReader::Shutdown() which calls ReleaseResources() [2]. Because |mVideoFrameContainer| is already cleared, |mVideoFrameContainer->ClearCurrentFrame()| is never called during the shutdown phase. It is even more interesting that when we really call |mVideoFrameContainer->ClearCurrentFrame()| during the shutdown phase, it crashes! The crash (comment 7) address is 0xffffffffe5e5e5f1 which is a UAF. Might need to use some helps from gfx guys. [1] https://hg.mozilla.org/mozilla-central/file/052656fc513c05da969590ac5934abd67271a897/dom/media/MediaFormatReader.cpp#l141 [2] https://hg.mozilla.org/mozilla-central/file/052656fc513c05da969590ac5934abd67271a897/dom/media/MediaDecoderReader.cpp#l523 [3] https://hg.mozilla.org/mozilla-central/file/052656fc513c05da969590ac5934abd67271a897/dom/media/MediaFormatReader.cpp#l1977
Flags: needinfo?(jwwang)
https://hg.mozilla.org/try/rev/c63516139d86e9ab14238934aadf4719922edba8 This change still got crashes. I am almost sure there is something wrong in gfx so that calling ClearCurrentFrame() during shutdown causes crash.
Attachment #8782212 - Attachment is obsolete: true
Attachment #8784643 - Flags: review?(jyavenard)
Comment on attachment 8784643 [details] Bug 1295906 - Remove the call to |mVideoFrameContainer->ClearCurrentFrame()| from ReleaseResources(). https://reviewboard.mozilla.org/r/73984/#review71980
Attachment #8784643 - Flags: review?(jyavenard) → review+
Thanks!
Pushed by jyavenard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/112c00ceea7c Remove the call to |mVideoFrameContainer->ClearCurrentFrame()| from ReleaseResources(). r=jya
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: