Closed Bug 493443 Opened 16 years ago Closed 15 years ago

Should transition to HAVE_CURRENT_DATA whenever Ogg frame queue is empty

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 2 obsolete files)

I think (but I'm not 100% sure) than when we empty the frame queue during seeking, we should enter HAVE_CURRENT_DATA and stay there until we get a frame queued up after the current frame, even if we have the entire resource buffered in the media cache. Basically the question is what readyState means for our Ogg decoder. I propose that we simply say this: -- if we have a frame queued up after the current frame, then readyState is either HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA, depending on how much data is buffered in the media cache. -- otherwise we have no frame queued up after the current frame and readyState is HAVE_CURRENT_DATA. Currently we have something more complicated, like this: -- if we have a frame queued up after the current frame, OR the decoder IsEnded, OR all the data has been downloaded, then readyState is either HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA, depending on how much data is buffered in the media cache. -- otherwise readyState is HAVE_CURRENT_DATA. So currently when we seek, if not all of the resource has been buffered (e.g. all bytes except the last one buffered) we enter HAVE_CURRENT_DATA, otherwise we stay in HAVE_ENOUGH_DATA. That seems wrong.
If we do this change, then we can also simplify the treatment of the ended state. In the ended state, the frame queue is empty so UpdateReadyStateForData will automatically set readyState to HAVE_CURRENT_DATA.
Attached patch fix (obsolete) (deleted) — Splinter Review
By passing the NEXT_FRAME_UNAVAILABLE_BUFFERING frame-queue status while seeking, we fire a 'waiting' event during seeking. This is seems like the right thing according to the spec. I've made nsOggDecoder::PlaybackEnded be dispatched synchronously. Otherwise I'm afraid someone may trigger a seek and seeking and decoding activity could happen before PlaybackEnded actually runs, which seems bad.
Assignee: nobody → roc
Attachment #377924 - Flags: review?(chris.double)
Attached patch fix v2 (obsolete) (deleted) — Splinter Review
The Wave decoder needs to be updated to call UpdateReadyStateForData a bit more, so that removing the ChangeReadyState call from nsHTMLMediaElement::PlaybackEnded doesn't regress Wave.
Attachment #377924 - Attachment is obsolete: true
Attachment #377964 - Flags: review?(chris.double)
Attachment #377924 - Flags: review?(chris.double)
Attachment #377964 - Attachment is patch: true
Attachment #377964 - Attachment mime type: application/octet-stream → text/plain
Attached patch fix v3 (deleted) — Splinter Review
One more change to UpdateReadyStateForData: we should check IsBuffering and IsSeeking before we check HaveNextFrame, because it's possible for us to be buffering while we have multiple frames in the queue, but we should still show the throbber while buffering.
Attachment #377964 - Attachment is obsolete: true
Attachment #377976 - Flags: review?(chris.double)
Attachment #377964 - Flags: review?(chris.double)
Whiteboard: [needs review]
Attachment #377976 - Flags: review?(chris.double) → review+
Comment on attachment 377976 [details] [diff] [review] fix v3 + PRBool IsSeeking() const { + return mState == nsOggDecodeStateMachine::DECODER_STATE_SEEKING; + } Missing comment about needing decoder monitor held. Maybe assert it?
Status: NEW → RESOLVED
Closed: 15 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [needs review] → [needs 191 landing]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: