Closed Bug 814308 Opened 12 years ago Closed 11 years ago

MediaDecoder::SetDuration doesn't handle aDuration=inf correctly

Categories

(Core :: Audio/Video, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: kinetik, Assigned: padenot)

Details

Attachments

(1 file)

For example, if a clone is created via InitializeDecoderAsClone, MediaDecoder::GetDuration() may return inf, a double >= 0, or NaN.  This value is then passed to the clone's MediaDecoder::SetDuration, which assumes aDuration is >= 0 and static casts the value to int64_t.
I used |mfbt/FloatingPoint.h| header because |std::isnan| and familly is apparently
not available on Windows.
Attachment #695801 - Flags: review?(kinetik)
Assignee: nobody → paul
Comment on attachment 695801 [details] [diff] [review]
MediaDecoder::SetDuration doesn't handle aDuration=inf correctly.  r=

+  } else if (MOZ_DOUBLE_IS_NaN(aDuration)) {
+    mDuration = -1;

Do we need to SetInfinite(true) here, too? MetadataLoaded treats a duration of -1 from the state machine as infinite.
Attachment #695801 - Flags: review?(kinetik) → review+
Push backed out for Windows pgo-only mochitest-1 timeouts in media tests, since the backout of just 1abf4c88f8f1 didn't work (see bug 793274 comment 12 for example logs):
https://hg.mozilla.org/integration/mozilla-inbound/rev/f2912b7e727a
https://hg.mozilla.org/integration/mozilla-inbound/rev/ea7f8d86e592

I bisected the queue on try, this patch is safe.
https://hg.mozilla.org/mozilla-central/rev/ea7f8d86e592
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: