@@ -1368,12 +1368,17 @@ shaka.media.StreamingEngine = class {
1368
1368
return null ;
1369
1369
}
1370
1370
1371
+ // Update updateIntervalSeconds according to our current playbackrate,
1372
+ // and always considering a minimum of 1.
1373
+ const updateIntervalSeconds = this . config_ . updateIntervalSeconds /
1374
+ Math . max ( 1 , Math . abs ( this . playerInterface_ . getPlaybackRate ( ) ) ) ;
1375
+
1371
1376
if ( ! this . playerInterface_ . mediaSourceEngine . isStreamingAllowed ( ) &&
1372
1377
mediaState . type != ContentType . TEXT ) {
1373
1378
// It is not allowed to add segments yet, so we schedule an update to
1374
1379
// check again later. So any prediction we make now could be terribly
1375
1380
// invalid soon.
1376
- return this . config_ . updateIntervalSeconds / 2 ;
1381
+ return updateIntervalSeconds / 2 ;
1377
1382
}
1378
1383
1379
1384
const logPrefix = shaka . media . StreamingEngine . logPrefix_ ( mediaState ) ;
@@ -1445,9 +1450,8 @@ shaka.media.StreamingEngine = class {
1445
1450
shaka . log . v2 ( logPrefix , 'buffering goal met' ) ;
1446
1451
1447
1452
// Do not try to predict the next update. Just poll according to
1448
- // configuration (seconds). The playback rate can change at any time, so
1449
- // any prediction we make now could be terribly invalid soon.
1450
- return this . config_ . updateIntervalSeconds / 2 ;
1453
+ // configuration (seconds).
1454
+ return updateIntervalSeconds / 2 ;
1451
1455
}
1452
1456
1453
1457
// Lack of segment iterator is the best indicator stream has changed.
@@ -1459,7 +1463,7 @@ shaka.media.StreamingEngine = class {
1459
1463
// In any case just try again... if the manifest is incomplete or is not
1460
1464
// being updated then we'll idle forever; otherwise, we'll end up getting
1461
1465
// a SegmentReference eventually.
1462
- return this . config_ . updateIntervalSeconds ;
1466
+ return updateIntervalSeconds ;
1463
1467
}
1464
1468
// Get media state adaptation and reset this value. By guarding it during
1465
1469
// actual stream change we ensure it won't be cleaned by accident on regular
@@ -1498,7 +1502,7 @@ shaka.media.StreamingEngine = class {
1498
1502
// For example, let video buffering catch up to audio buffering before
1499
1503
// fetching another audio segment.
1500
1504
shaka . log . v2 ( logPrefix , 'waiting for other streams to buffer' ) ;
1501
- return this . config_ . updateIntervalSeconds ;
1505
+ return updateIntervalSeconds ;
1502
1506
}
1503
1507
1504
1508
if ( mediaState . segmentPrefetch && mediaState . segmentIterator &&
0 commit comments