Closed
Bug 588312
Opened 14 years ago
Closed 14 years ago
When set, video.currentTime returns old value until seek completes
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: kinetik, Assigned: cajbir)
References
()
Details
Attachments
(2 files, 3 obsolete files)
726 bytes,
text/html
|
Details | |
9.46 KB,
patch
|
cajbir
:
review+
|
Details | Diff | Splinter Review |
When video.currentTime is set to a new position, video.seeking becomes true immediately but video.currentTime returns the old value until the seeked event fires.
The spec (step 8) says that currentTime should reflect the new position before seeking is fired.
Testcase attached.
Reporter | ||
Comment 1•14 years ago
|
||
Attach testcase, like, for real.
Reporter | ||
Comment 2•14 years ago
|
||
Better testcase. This also shows that we fire timeupdate just before seeked, rather than just after seeking as the spec requires.
Attachment #466934 -
Attachment is obsolete: true
Reporter | ||
Comment 3•14 years ago
|
||
When this is fixed, please also revert the workaround made in videocontrols.xml:
case "seeked":
+ // XXX: This call to showBuffered() can be removed
+ // when bug 588312 is fixed.
+ this.showBuffered();
+ this.setupStatusFader();
+ break;
case "playing":
Assignee | ||
Comment 4•14 years ago
|
||
Requesting blocking as it blocks blocking bug 584615.
Assignee: nobody → chris.double
blocking2.0: --- → ?
Assignee | ||
Comment 5•14 years ago
|
||
Attachment #472531 -
Flags: review?(kinetik)
Assignee | ||
Updated•14 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Comment 6•14 years ago
|
||
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
Did you mean to remove this?
mElement->SeekStarted();
+ mElement->DispatchSimpleEvent(NS_LITERAL_STRING("timeupdate"));
Can we move the timeupdate into SeekStarted()? That way other (non-nsBuiltin) backends will have the correct behaviour.
The Wave backend needs a similar fix to what you've done in nsBuiltinDecoderStateMachine::Run(). And I'm not sure if the Wave backend is tested--test_timeupdate3 is Ogg specific. We should convert it to a backend independent test.
Comment 7•14 years ago
|
||
Comment on attachment 472531 [details] [diff] [review]
Fix
Drive by review...
>diff --git a/content/media/nsBuiltinDecoder.cpp b/content/media/nsBuiltinDecoder.cpp
>index 2baa287..76b2b0a 100644
>--- a/content/media/nsBuiltinDecoder.cpp
>+++ b/content/media/nsBuiltinDecoder.cpp
>@@ -703,6 +703,7 @@ void nsBuiltinDecoder::SeekingStarted()
> if (mElement) {
> UpdateReadyStateForData();
> mElement->SeekStarted();
>+ mElement->DispatchSimpleEvent(NS_LITERAL_STRING("timeupdate"));
> }
> }
Does the UpdatePlaybackPosition(seekTime) call you added already cause a timeupdate to be dispatched if the playback position changes?
>diff --git a/content/media/nsBuiltinDecoderStateMachine.cpp b/content/media/nsBuiltinDecoderStateMachine.cpp
>index 4ba3523..a22df31 100644
>--- a/content/media/nsBuiltinDecoderStateMachine.cpp
>+++ b/content/media/nsBuiltinDecoderStateMachine.cpp
>@@ -980,6 +979,16 @@ nsresult nsBuiltinDecoderStateMachine::Run()
> PRInt64 seekTime = mSeekTime;
> mDecoder->StopProgressUpdates();
>
>+ PRBool currentTimeChanged = false;
>+ PRInt64 currentTime = mStartTime + mCurrentFrameTime;
Variable currentTime is unused?
>diff --git a/content/media/test/test_timeupdate3.html b/content/media/test/test_timeupdate3.html
>index 0fb1a3a..b6e7c85 100644
>--- a/content/media/test/test_timeupdate3.html
>+++ b/content/media/test/test_timeupdate3.html
>@@ -27,16 +28,19 @@ function startSeek() {
> return false;
>
> seeking = true;
>+ var v = document.getElementById('v');
>+ ok(v.currentTime == 2.0,
>+ "Check currentTime of " + v.currentTime + " is requested seek time");
s/2.0/seekTime/ ?
Reporter | ||
Comment 8•14 years ago
|
||
(In reply to comment #7)
> Does the UpdatePlaybackPosition(seekTime) call you added already cause a
> timeupdate to be dispatched if the playback position changes?
Not necessarily, because mPositionChangeQueued might be true which would suppress sending the timeupdate caused by seeking.
blocking2.0: ? → final+
Assignee | ||
Comment 9•14 years ago
|
||
Addresses review comments. I've made test_timeupdate3 a backend independent test and renamed it to test_timeupdate_seek.
> Does the UpdatePlaybackPosition(seekTime) call you added already cause a
> timeupdate to be dispatched if the playback position changes?
I've not changed this since allowing for it complicates the code quite a bit and the gain of not having one additional timeupdate on a seek start didn't seem worth it. If it's still an issue can we create a bug specific for it to address the refactoring that would be needed to do it?
Attachment #472531 -
Attachment is obsolete: true
Attachment #473874 -
Flags: review?(kinetik)
Attachment #472531 -
Flags: review?(kinetik)
Reporter | ||
Comment 10•14 years ago
|
||
Comment on attachment 473874 [details] [diff] [review]
Fix
if (NS_FAILED(rv)) {
NS_WARNING("Seek failed");
- }
- monitor.Enter();
- if (NS_SUCCEEDED(rv)) {
- mPlaybackPosition = position;
+ mPlaybackPosition = oldPosition;
}
We need to fire a timeupdate for this. It turns out we do because we call FirePositionChanged(PR_TRUE) further down in the SEEKING state. I think it'd be better to move that call inside the if here, since we've already fired back a timeupdate at the start of the sek in the success case.
r+ with that.
Attachment #473874 -
Flags: review?(kinetik) → review+
Assignee | ||
Comment 11•14 years ago
|
||
Address final review comment and add commit message to patch. carried r=kinetik forward.
Attachment #473874 -
Attachment is obsolete: true
Attachment #473902 -
Flags: review+
Assignee | ||
Updated•14 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 12•14 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•