[Webkit-unassigned] [Bug 190893] New: [MSE][WTF][Media] Invalid MediaTime should be falsy

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Oct 24 17:04:25 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=190893

            Bug ID: 190893
           Summary: [MSE][WTF][Media] Invalid MediaTime should be falsy
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Gtk
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: aboya at igalia.com
                CC: bugs-noreply at webkitgtk.org

Currently MediaTime::invalidTime() is evaluated as true in the context of a boolean evaluation. This behavior is surprising and I've already seen some code fall on it. In particular, in SourceBuffer:

} else if (trackBuffer.roundedTimestampOffset) {
    // Reflect the timestamp offset into the sample.
    sample.offsetTimestampsBy(trackBuffer.roundedTimestampOffset);
}

There, the intention would be to offset the timestamps of the sample if and only if a valid non-zero timestamp offset exists. But with the current definition of MediaTime::operator bool, an invalid time is true. I definitively did not expect that, did you?

This patch includes:

1. A mock MSE test case replicating a bug caused by that assumption.

2. A change in the definition of MediaTime::operator bool() and MediaTime::operator!() so that invalid times are falsy.

3. Additional API tests for conversions of MediaTime to bool.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20181025/28d57687/attachment.html>


More information about the webkit-unassigned mailing list