Closed
Bug 1086198
Opened 10 years ago
Closed 10 years ago
[RTSP] The unit of property duration of media element is not in seconds
Categories
(Firefox OS Graveyard :: RTSP, defect)
Tracking
(firefox34 wontfix, firefox35 wontfix, firefox36 fixed, b2g-v2.1 fixed, b2g-v2.2 fixed)
RESOLVED
FIXED
2.1 S8 (7Nov)
People
(Reporter: ethan, Assigned: ethan)
References
Details
(Keywords: verifyme, Whiteboard: [p=1])
Attachments
(2 files, 5 obsolete files)
3.72 KB,
patch
|
Details | Diff | Splinter Review | |
3.69 KB,
patch
|
ethan
:
review+
bajaj
:
approval-mozilla-b2g34+
|
Details | Diff | Splinter Review |
The property "duration" of media element indicates the length of the media in
seconds, or zero if no media is available.
In the WIP patch of bug 1032111, we create a video element and specify an RTSP
link as its src. After the media is loaded, we obtain the property duration and
find it is in microseconds, not seconds.
/*** JS code snippet ***/
videoElement = document.createElement("video");
source = document.createElement("source");
source.src = aUrl;
videoElement.appendChild(source);
document.body.appendChild(videoElement);
videoElement.play();
// wait for loaded ....
videoDuration = videoElement.duration; // this is in microseconds!
/*** end of JS code snippet ***/
We compared RTSP with HTTP stream. The latter has the duration in seconds.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → ettseng
Assignee | ||
Comment 1•10 years ago
|
||
http://dxr.mozilla.org/mozilla-central/source/content/media/RtspMediaResource.cpp#724
RtspMediaResource::OnConnected() passes the duration in units of microseconds to
MediaDecoder::SetDuration().
Summary: [RTSP] Unit of property duration of media element is not in seconds → [RTSP] The unit of property duration of media element is not in seconds
Assignee | ||
Comment 2•10 years ago
|
||
Assignee | ||
Comment 3•10 years ago
|
||
Comment on attachment 8510105 [details] [diff] [review]
Fix the unit of argument to Decoder::SetDuration()
Benjamin, can you review this patch?
Attachment #8510105 -
Flags: review?(bechen)
Comment 4•10 years ago
|
||
Comment on attachment 8510105 [details] [diff] [review]
Fix the unit of argument to Decoder::SetDuration()
Review of attachment 8510105 [details] [diff] [review]:
-----------------------------------------------------------------
Hi Chris:
Do you know what's the difference between MediaDecoder::SetDuration and MediaDecoder::SetMediaDuration?
In this case, which one we should use?
::: content/media/RtspMediaResource.cpp
@@ +725,1 @@
> } else {
Should we use USECS_PER_S?
Attachment #8510105 -
Flags: review?(bechen) → review?(cpearce)
Assignee | ||
Comment 5•10 years ago
|
||
Hi Chris,
Could you review this patch?
This is a small but silly bug.
We haven't noticed it until recently because the video control always shows
the correct duration. However, it is wrong when we retrieve the duration from
a media element containing RTSP stream as its source.
Meanwhile, I don't quite understand the difference between MediaDecoder::
SetDuration() and SetMediaDuration().
Could we invoke the latter so that we can avoid unnecessary unit conversions?
Attachment #8510105 -
Attachment is obsolete: true
Attachment #8510105 -
Flags: review?(cpearce)
Attachment #8510126 -
Flags: review?(cpearce)
Assignee | ||
Comment 6•10 years ago
|
||
Refine code comment.
Attachment #8510126 -
Attachment is obsolete: true
Attachment #8510126 -
Flags: review?(cpearce)
Attachment #8510214 -
Flags: review?(cpearce)
Comment 7•10 years ago
|
||
Comment on attachment 8510214 [details] [diff] [review]
Fix the unit of argument to Decoder::SetDuration()
Review of attachment 8510214 [details] [diff] [review]:
-----------------------------------------------------------------
r=cpearce with change below.
::: content/media/RtspMediaResource.cpp
@@ +721,4 @@
> // Not live stream.
> mRealTime = false;
> mDecoder->SetInfinite(false);
> + mDecoder->SetDuration(durationUs / USECS_PER_S);
You should probably use:
double(durationUs) / USECS_PER_S
Otherwise the duration may be calculated as (double((int64_t)durationUs) / (int64_t)USECS_PER_S)), which would round to the nearest second, which is not what we want for a double value.
Attachment #8510214 -
Flags: review?(cpearce) → review+
Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8510214 [details] [diff] [review]
Fix the unit of argument to Decoder::SetDuration()
Review of attachment 8510214 [details] [diff] [review]:
-----------------------------------------------------------------
::: content/media/RtspMediaResource.cpp
@@ +721,4 @@
> // Not live stream.
> mRealTime = false;
> mDecoder->SetInfinite(false);
> + mDecoder->SetDuration(durationUs / USECS_PER_S);
Right! Thanks for reminding me that.
Assignee | ||
Comment 9•10 years ago
|
||
Addressed the issue in the review comment.
Attachment #8510214 -
Attachment is obsolete: true
Assignee | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Whiteboard: [p=1]
Target Milestone: --- → 2.1 S7 (24Oct)
Assignee | ||
Comment 10•10 years ago
|
||
The result of Treeherder:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=d87a0dd29f4f
Keywords: checkin-needed
Comment 11•10 years ago
|
||
Keywords: checkin-needed
Comment 12•10 years ago
|
||
sorry had to back this out for bustage like https://treeherder.mozilla.org/ui/logviewer.html#?job_id=697519&repo=b2g-inbound
Assignee | ||
Comment 13•10 years ago
|
||
Include VideoUtils.h to fix build bustage.
Attachment #8510845 -
Attachment is obsolete: true
Assignee | ||
Comment 14•10 years ago
|
||
Sorry I should run debug build as well.
The result of Treeherder for the updated patch:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=d0cbc3150039
Keywords: checkin-needed
Assignee | ||
Comment 15•10 years ago
|
||
Hi Carsten,
I requested to check in the updated patch.
Could you help on that? :)
Flags: needinfo?(cbook)
Assignee | ||
Comment 16•10 years ago
|
||
Oops! I just found some code paths were changed.
I need to rebase my patch. Cancel the request.
Keywords: checkin-needed
Assignee | ||
Comment 17•10 years ago
|
||
Rebase the patch because the directory m-c/content/media was moved to
m-c/dom/media.
Attachment #8511073 -
Attachment is obsolete: true
Assignee | ||
Comment 18•10 years ago
|
||
The result of Treeherder:
https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=30e6820beaeb
Keywords: checkin-needed
Comment 19•10 years ago
|
||
Keywords: checkin-needed
Comment 20•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: 2.1 S7 (24Oct) → 2.1 S8 (7Nov)
Assignee | ||
Comment 21•10 years ago
|
||
Comment on attachment 8512503 [details] [diff] [review]
Fix the unit of argument to Decoder::SetDuration()
[Approval Request Comment]
Bug caused by (feature/regressing bug #): None
User impact if declined: Could get incorrect duration of media element.
Testing completed: On m-c
Risk to taking this patch (and alternatives if risky): None
String or UUID changes made by this patch: None
Attachment #8512503 -
Flags: approval-mozilla-b2g34?
Attachment #8512503 -
Flags: approval-mozilla-b2g32?
Assignee | ||
Updated•10 years ago
|
Flags: needinfo?(cbook)
Comment 22•10 years ago
|
||
:ethan, from the read of the comments the issue does not look major and this can ride the trains. Please explain the user impact if you consider this to be a ship-blocker which in the kind of issue qualify for uplift/blocking here.
Flags: needinfo?(ettseng)
Assignee | ||
Comment 23•10 years ago
|
||
(In reply to bhavana bajaj [:bajaj] from comment #22)
> :ethan, from the read of the comments the issue does not look major and this
> can ride the trains. Please explain the user impact if you consider this to
> be a ship-blocker which in the kind of issue qualify for uplift/blocking
> here.
Hi Bhavana,
Right. This issue is not major. Let's put it ride the trains.
Then I'll cancel the uplift requests. Thanks for your time.
Flags: needinfo?(ettseng)
Assignee | ||
Updated•10 years ago
|
Attachment #8512503 -
Flags: approval-mozilla-b2g34?
Attachment #8512503 -
Flags: approval-mozilla-b2g32?
Assignee | ||
Comment 25•10 years ago
|
||
The same fix but rebased for v2.1 (mozilla-b2g34_v2_1).
Previously we decided not to uplift the patch to v2.1 (comment 22 and 23)
because users should not notice this bug.
However, one of our partners found a random duration issue in bug 1112030
recently. If necessary, we can uplift the fix to v2.1.
Attachment #8537846 -
Flags: review+
Assignee | ||
Comment 26•10 years ago
|
||
Comment on attachment 8537846 [details] [diff] [review]
bug-1086198-fix-v2.1
[Approval Request Comment]
Bug caused by (feature/regressing bug #): Bug 1112030
User impact if declined: Incorrect duration is shown in RTSP streaming
Testing completed: On v2.1
Risk to taking this patch (and alternatives if risky): None
String or UUID changes made by this patch: None
Attachment #8537846 -
Flags: approval-mozilla-b2g34?
Assignee | ||
Comment 27•10 years ago
|
||
The result of Treeherder:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=ac5768332de7
Comment 28•10 years ago
|
||
Comment on attachment 8537846 [details] [diff] [review]
bug-1086198-fix-v2.1
Approving given the latest partner issue.
Attachment #8537846 -
Flags: approval-mozilla-b2g34? → approval-mozilla-b2g34+
Comment 29•10 years ago
|
||
status-b2g-v2.1:
--- → fixed
status-b2g-v2.2:
--- → fixed
status-firefox34:
--- → wontfix
status-firefox35:
--- → wontfix
status-firefox36:
--- → fixed
Comment 30•10 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #29)
> https://hg.mozilla.org/releases/mozilla-b2g34_v2_1/rev/cc9a90b5d66b
Hi Ryan:
Please help to check this fix already landed in v2.1.
Thanks!
Flags: needinfo?(ryanvm)
You need to log in
before you can comment on or make changes to this bug.
Description
•