Closed Bug 1057954 Opened 10 years ago Closed 10 years ago

[B2G debug] Intermittent test_standalone.html | ASSERTION: Decoder fired ended, but not in ended state: '!mDecoder || mDecoder->IsEnded()', file ../../../../../gecko/content/html/content/src/HTMLMediaElement.cpp, line 3043

Categories

(Core :: Audio/Video, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: jwwang, Assigned: jwwang)

References

Details

Attachments

(1 file, 1 obsolete file)

https://tbpl.mozilla.org/php/getParsedLog.php?id=46476997&tree=Try&full=1#error0

Found this issue while running media tests on B2G emulator debug build.

08:15:58     INFO -  2261 INFO [Child 737] ###!!! ASSERTION: Decoder fired ended, but not in ended state: '!mDecoder || mDecoder->IsEnded()', file ../../../../../gecko/content/html/content/src/HTMLMediaElement.cpp, line 3043
Assignee: nobody → jwwang
Blocks: 962871
Status: NEW → ASSIGNED
Here is the story that causes the assertion:

1. MediaDecoderStateMachine reaches playback completed state and wants to dispatch MediaDecoder::PlaybackEnded(). [1]
2. Since it is a sync dispatch, MediaDecoderStateMachine has to release the monitor before dispatching.
3. Meanwhiel, the main thread kicks in and MediaDecoder::SetDormantIfNecessary() is called.
4. SetDormantIfNecessary() enters the monitor and do anything necessary for dormant.
5. Now it is MediaDecoder::PlaybackEnded()'s turn which tries change state to PLAY_STATE_ENDED but it fails silently for ChangeState() will just return in dormant state. [2]
6. Following step 5, HTMLMediaElement::PlaybackEnded() is called in MediaDecoder::PlaybackEnded().
7. It hits the assertion for the play state of MediaDecoder didn't change to PLAY_STATE_ENDED.


[1] http://hg.mozilla.org/mozilla-central/file/1db35d2c9a2f/content/media/MediaDecoderStateMachine.cpp#l2471
[2] http://hg.mozilla.org/mozilla-central/file/1db35d2c9a2f/content/media/MediaDecoder.cpp#l1166
See comment 1 for the root cause.

Fix: MediaDecoder::PlaybackEnded should just return in dormant state. MediaDecoder and MediaDecoderStateMachine will change state properly when leaving dormant state.
Attachment #8482062 - Flags: review?(kinetik)
Attachment #8482062 - Flags: review?(kinetik) → review+
Fix parenthesis warnings.
Attachment #8482062 - Attachment is obsolete: true
Attachment #8483225 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/8cc63a38bfc7
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: