mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-25 17:45:03 +03:00
Minor clean-up in Stream.
Use Stream.BUFFER_SIZE_SECONDS_ on startup. Improved the way adaptation latency is measured. Avoid calling abort() twice during adaptation. Reduce the size of the Promise chain slightly. Merge the SPLICING state into SWITCHING. Change-Id: Ie06e6c56df4df17e7acb379d0e19f639f791c99b
This commit is contained in:
committed by
Gerrit Code Review
parent
b6753da727
commit
fa931883f7
+16
-4
@@ -60,15 +60,16 @@ shaka.timer.end = function(name) {
|
||||
|
||||
|
||||
/**
|
||||
* Log (debug) the diff between two completed timers and return it.
|
||||
* Does nothing if either timer has not begun.
|
||||
* Log (debug) the diff between two or more completed timers and return it.
|
||||
* Does nothing if not all of the timers have begun.
|
||||
*
|
||||
* @param {string} name1
|
||||
* @param {string} name2
|
||||
* @return {number} The diff between the two, or NaN if they are not both
|
||||
* @param {...string} var_args
|
||||
* @return {number} The diff between the timers, or NaN if they have not all
|
||||
* completed.
|
||||
*/
|
||||
shaka.timer.diff = function(name1, name2) {
|
||||
shaka.timer.diff = function(name1, name2, var_args) {
|
||||
var t1 = shaka.timer.get(name1);
|
||||
var t2 = shaka.timer.get(name2);
|
||||
if (!t1 || !t2) {
|
||||
@@ -76,6 +77,17 @@ shaka.timer.diff = function(name1, name2) {
|
||||
}
|
||||
var diff = t1 - t2;
|
||||
var name = name1 + ' - ' + name2;
|
||||
|
||||
for (var i = 2; i < arguments.length; ++i) {
|
||||
var name3 = arguments[i];
|
||||
var t3 = shaka.timer.get(name3);
|
||||
if (!t3) {
|
||||
return NaN;
|
||||
}
|
||||
diff -= t3;
|
||||
name += ' - ' + name3;
|
||||
}
|
||||
|
||||
shaka.log.debug(name + ': ' + diff.toFixed(3) + 'ms');
|
||||
return diff;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user