gecko-dev/dom
Kaku Kuo c79eb6f91f Bug 1290371 - handle files with audio and video tracks but no samples at all; r=jya
So, we have 4 boolean variables and here is the truth table.
Case 1, 2, 3, 4, 7, 8, 10 and 12 are not possible to happen.

Then, the remaining cases could be clustered into three categories:
(1) Case 5, 9 and 13: no sample is demuxed at all, return 0.
(2) Case 6, 11, 14 and 15: either audio or video is able to be demuxed, return the known value.
(3) Case 15: both audio and video are demuxed, return the minimum of the values.


For simplifying the logic, I will initialize the audioStartTime and videoStartTime
to be INFINITY if we don't have the first-demuxed sample, otherwise, initialize
them to be the real first-demuxed sample's time.

Then, the final calculation will be:
(1) Case 5, 9 and 13: the minimum of two INFINITY values is still INFINITY, return 0.
(2) Case 6, 11, 14 and 15: return the minimum of one real first-demuxed-time and the INFINITY.
(3) Case 15: return the minimum of two real first-demuxed-time values.

Case   HasAudio   HasVideo   HasAudioSample   HasVideoSample    ExpectedResult
---------------------------------------------------------------------------------------------------
1         F          F             F                 F          not possible
2         F          F             F                 T          not possible
3         F          F             T                 F          not possible
4         F          F             T                 T          not possible
---------------------------------------------------------------------------------------------------
5         F          T             F                 F          return 0
6         F          T             F                 T          return video sample
7         F          T             T                 F          not possible
8         F          T             T                 T          not possible
---------------------------------------------------------------------------------------------------
9         T          F             F                 F          return 0
10        T          F             F                 T          not possible
11        T          F             T                 F          return audio sample
12        T          F             T                 T          not possible
---------------------------------------------------------------------------------------------------
13        T          T             F                 F          return 0
14        T          T             F                 T          return videoSample
15        T          T             T                 F          return audioSample
16        T          T             T                 T          return min(auidoSample, videoSample)

MozReview-Commit-ID: ANsYDth7slJ

--HG--
extra : transplant_source : %DAj%1A%EC%19%82%7B%B3%05%FE%21%04a%16%9A%9F%18x1%95
2016-08-03 16:51:29 +08:00
..
alarm Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
animation Bug 1282312 - Part 3: Add test for disabling of async animations with rendering observers. r=hiro 2016-07-29 17:59:02 +12:00
apps Backed out changeset 16aa7041c009 (bug 1287107) for causing xpcshell and mac tests 2016-07-22 11:30:23 +02:00
archivereader Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
asmjscache Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
audiochannel Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
base Bug 1289872 - Fixed the warning log spams due to bug 1275833. r=wchen 2016-08-04 04:22:00 +02:00
battery Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
bindings Bug 1278583 part 5. Switch DOM code from using hasInstance class hooks to using Symbol.hasInstance. r=peterv 2016-08-03 18:32:07 -07:00
bluetooth Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
broadcastchannel merge mozilla-inbound to mozilla-central a=merge 2016-07-25 15:50:41 +02:00
browser-element backout f0d2679582bea4d7d74ea47d4b1f7f458b1bd359 (bug 1287720) for causing Android 4.3 opt mochitest-chrome application timeouts 2016-07-27 15:12:04 -06:00
cache merge mozilla-inbound to mozilla-central a=merge 2016-07-25 15:50:41 +02:00
camera Bug 1201363 - Let MediaStreamVideoSink bind with particular video track. r=jesup 2016-05-27 14:33:50 +08:00
canvas Bug 1291612 - update webgl conformance test gl-object-get-calls.js. r=mtseng 2016-08-02 22:52:00 +02:00
cellbroadcast Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
console merge mozilla-inbound to mozilla-central a=merge 2016-07-22 11:58:02 +02:00
contacts Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
crypto Bug 1289330 - Check for success when calling ToKeyAlgorithm() r=bz 2016-07-28 10:21:23 +02:00
devicestorage Bug 1288924 - Remove __func__ polyfill for VS2013. r=froydnj 2016-07-25 01:14:31 -07:00
downloads Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
encoding Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
events Merge mozilla-central to autoland 2016-08-03 17:08:48 +02:00
fetch Bug 1264164 - Support Referrer Policy HTTP header. r=jdm 2016-07-19 15:38:26 +08:00
filehandle Bug 1288077: Forward declare arrays by including 'nsTArrayForwardDeclare.h', r=froydnj 2016-07-20 17:29:36 +02:00
filesystem Bug 1284742 - Replace profile directory traversal with a generated directory tree in dom/filesystem/test/test_basic.html. r=mystor 2016-08-02 15:48:13 -04:00
flyweb Bug 1278439 (part 3) - Adding a missing prefs service null check in dom/flyweb/. r=djvj. 2016-07-15 13:12:57 +10:00
fmradio Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
gamepad merge mozilla-inbound to mozilla-central a=merge 2016-07-22 11:58:02 +02:00
geolocation Bug 1287706 part 1 - Make CallbackObjectHolder movable (and actually move-only). r=smaug 2016-07-28 12:00:06 +10:00
grid Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
html Bug 1283023 - Implement the step attribute for <input type=month>. r=smaug 2016-08-03 02:54:00 +02:00
icc Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
identity Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
imptests Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
indexedDB Bug 1289179. IDBRequest::SetResultCallback should expose its script owner to active JS before entering its compartment. r=baku 2016-07-27 11:05:36 -04:00
inputmethod Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
inputport Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
interfaces Bug 824592 part 3. Get rid of nsIDOMElementCSSInlineStyle. r=peterv 2016-08-02 11:05:38 -07:00
ipc Merge mozilla-central to fx-team 2016-08-02 17:13:42 +02:00
json Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
jsurl Bug 1280584 - implement cloneWithNewRef and thereby make hash/ref links use a simple unified codepath in the IO service, r=valentin 2016-07-26 23:38:46 +01:00
locales Bug 1282312 - Part 2: Disable async animations when we have rendering observers. r=bbirtles 2016-07-29 17:58:32 +12:00
manifest Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
mathml Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
media Bug 1290371 - handle files with audio and video tracks but no samples at all; r=jya 2016-08-03 16:51:29 +08:00
messagechannel Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
mobileconnection Bug 1290642 - Allow PGO of MobileConnection.cpp because we no longer compile with VS2013. r=glandium 2016-07-28 11:45:44 -07:00
mobileid Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
mobilemessage merge mozilla-inbound to mozilla-central a=merge 2016-07-22 11:58:02 +02:00
network Bug 1288077: Forward declare arrays by including 'nsTArrayForwardDeclare.h', r=froydnj 2016-07-20 17:29:36 +02:00
newapps Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
nfc Bug 1275016 - Rename Endian.h to EndianUtils.h to avoid #include confusion with Android's endian.h stdlib header. r=froydnj 2016-05-22 13:31:11 -07:00
notification Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
offline Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
payment Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
performance Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
permission Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
phonenumberutils Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
plugins Bug 1255628 - Remove AndroidNativeWindow, as we can use the NDK functions directly now r=rbarker 2016-08-04 09:23:34 -05:00
power Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
presentation Bug 1287717 - Part 2, close receiver page while loading fail. r=smaug. 2016-08-04 09:46:14 +08:00
promise Bug 1278583 part 5. Switch DOM code from using hasInstance class hooks to using Symbol.hasInstance. r=peterv 2016-08-03 18:32:07 -07:00
push Bug 1285889 - Moving the ContextualIdentityService.jsm from from browser/components/contextualidentity into tookit/components/contextualidentity. r=baku 2016-07-11 20:03:00 +02:00
quota Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
res
resourcestats Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
secureelement
security Bug 1289085: CSP - Bail early if referrer directive has no valid src. r=dveditz 2016-07-31 07:57:22 +02:00
settings Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
simplepush Bug 1271198 - Convert Websockets to use AsyncOpen2(). r=jduell 2016-05-17 12:04:11 +02:00
smil Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
speakermanager Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
storage Bug 1284674 - Remove NUWA r=cyu 2016-08-02 14:54:00 +02:00
svg Bug 843480 - zoom on iframe is applied twice. r=jwatt 2016-08-03 07:37:35 +01:00
system merge mozilla-inbound to mozilla-central a=merge 2016-07-22 11:58:02 +02:00
telephony Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
tests Bug 931445 - Part 5 - Avoid childIframe subtest to be started twice. r=smaug 2016-08-03 15:14:49 +10:00
tethering Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
time Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
tv Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
u2f Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
url Bug 1287657 - Context menu items should not be disabled for media with a blob URL; r=kinetik, r=baku 2016-07-25 22:41:52 +12:00
voicemail Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
vr Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
wappush
webidl merge mozilla-inbound to mozilla-central a=merge 2016-08-03 17:03:41 +02:00
wifi Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
workers Backed out 4 changesets (bug 1290116) for w-e10s(5) failures on linux 64 opt 2016-08-03 17:17:49 -07:00
xbl Backed out changeset c0bf6e0b8f1d (bug 1173199) for build bustage CLOSED TREE 2016-07-28 11:48:20 -07:00
xhr Bug 1285036 - Part 9: Clean up the XHR send() API endpoints, and how nsIVariants are handled. r=baku 2016-08-01 14:28:01 -04:00
xml Backed out changeset c0bf6e0b8f1d (bug 1173199) for build bustage CLOSED TREE 2016-07-28 11:48:20 -07:00
xslt Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
xul Bug 824592 part 3. Get rid of nsIDOMElementCSSInlineStyle. r=peterv 2016-08-02 11:05:38 -07:00
jar.mn
moz.build Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00