Closed Bug 469016 Opened 16 years ago Closed 16 years ago

Seeks after playback ended but before playback ended event are lost

Categories

(Core :: Audio/Video, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9.1b3

People

(Reporter: cpearce, Assigned: cpearce)

Details

(Keywords: verified1.9.1)

Attachments

(2 files)

When nsOggDecodeStateMachine decodes all of a video and moves to COMPLETED state, after it's played the last frame it sets an async callback to nsOggDecoder::PlaybackEnded(). nsOggDecodeStateMachine then goes into a loop while it's waiting for PlaybackEnded() to Stop() and shut it down. If there is a pending JS timeout which does a seek which runs after the PlaybackEnded() callback is set, but before the PlaybackEnded() callback fires, the seek will not trigger, and its seeking/seeked events won't fire either. This could cause intermittent test timeouts, if a testcase is seeking a playing media and relies on a seeking/onseeked event in order to terminate. The problem is that the loop in nsOggDecodeStateMachine::Run() COMPLETED case which waits for PlaybackEnded to shut down the state machine loops while (mState != SHUTDOWN). The state machine will be in COMPLETED state. Then nsOggDecoder::Seek() changes state the state machine's state to SEEKING, but when PlaybackEnded() fires it just overwrites the state with SHUTDOWN, obliterating the seek. One solution: * Change the while (mState != SHUTDOWN) loop in nsOggDecodeStateMachine::Run() COMPLETED case to while (mState == COMPLETED), and have PlaybackEnded bail out if (nsOggDecoder::mPlayState != SEEKING).
Attached file Testcase (deleted) —
Test case. Just run it, and eventually it will stop counting down. Check the log and you'll see that a seek was started, but ended was fired which canceled the seek.
Assignee: nobody → chris
Solution as described in comment 1.
Attachment #352456 - Flags: review?(chris.double)
Attachment #352456 - Flags: review?(chris.double) → review+
Attachment #352456 - Flags: superreview?(roc)
Attachment #352456 - Flags: superreview?(roc) → superreview+
Attachment #352456 - Attachment description: Patch v1 → Patch v1 [Checkin: Comment 3]
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing] → [c-n: baking for 1.9.1]
Target Milestone: --- → mozilla1.9.2a1
Attachment #352456 - Attachment description: Patch v1 [Checkin: Comment 3] → Patch v1 [Checkin: Comment 3 & 4]
Whiteboard: [c-n: baking for 1.9.1]
Target Milestone: mozilla1.9.2a1 → mozilla1.9.1b3
verified FIXED on builds: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2a1pre) Gecko/20090422 Minefield/3.6a1pre ID:20090422044118 and Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b4pre) Gecko/20090422 Shiretoko/3.5b4pre ID:20090422042031
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: