Skip to content

Commit f17dd7a

Browse files
Merge pull request #101 from bbc/update-default-threhodl
Video frames not advancing updates
2 parents f805e8e + 690479e commit f17dd7a

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/core/Settings.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ import Events from './events/Events';
111111
* setStallState: true,
112112
* videoFramesNotAdvancing: {
113113
* enabled: false
114-
* thresholdInSeconds: 2,
114+
* thresholdInSeconds: 5,
115115
* },
116116
* avoidCurrentTimeRangePruning: false,
117117
* useChangeTypeForTrackSwitch: true,
@@ -359,7 +359,7 @@ import Events from './events/Events';
359359
* @property {module:Settings~SyntheticStallSettings} [syntheticStallEvents]
360360
* Specified if we fire manual stall events once the stall threshold is reached
361361
*
362-
* @property {number} [videoFramesNotAdvancing={enabled:false,thresholdInSeconds:2}]
362+
* @property {number} [videoFramesNotAdvancing={enabled:false,thresholdInSeconds:5}]
363363
* Controls a mechanism for handling situations where the player is playing but stops advancing its total frame count to handle https://issues.chromium.org/issues/41243192.
364364
*
365365
* The 'enabled' property signifies whether we attempt to handle the bug should it occur by seeking to the current time.
@@ -1001,7 +1001,7 @@ function Settings() {
10011001
setStallState: true,
10021002
videoFramesNotAdvancing: {
10031003
enabled: false,
1004-
thresholdInSeconds: 2
1004+
thresholdInSeconds: 5
10051005
},
10061006
avoidCurrentTimeRangePruning: false,
10071007
useChangeTypeForTrackSwitch: true,

src/streaming/controllers/StreamController.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,11 @@ function StreamController() {
811811
&& !videoModel.isPaused()
812812
&& !videoModel.isStalled()
813813
&& videoModel.getReadyState() >= Constants.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA
814-
&& playbackQuality.totalVideoFrames > 0 // Handles devices (some tvs), where Video Quality API, totalVideoFrames always returns 0
815-
&& playbackQuality.totalVideoFrames !== playbackQuality.droppedVideoFrames // Handles devices (some tvs), where Video Quality API, totalVideoFrames always equals the number of dropped frames
816-
&& playbackQuality.totalVideoFrames <= totalVideoFramesAtLastPlaybackProgress // Total frames should advance with time progression, if not something is wrong
817-
814+
&& playbackQuality.totalVideoFrames > 0 // Handles devices (some TVs), where Video Quality API, totalVideoFrames always returns 0.
815+
&& playbackQuality.totalVideoFrames < 2147483647 //Handles devices (some WebKit TVs), where Video Quality API, totalVideoFrames can return the max value of a 32 bit signed integer becuase the implementation uses totalVideoFrames = mediaTime * framerate.
816+
&& playbackQuality.totalVideoFrames !== playbackQuality.droppedVideoFrames // Handles devices (some TVs), where Video Quality API, totalVideoFrames always equals the number of dropped frames.
817+
&& playbackQuality.totalVideoFrames === totalVideoFramesAtLastPlaybackProgress // Total frames should advance with time progression, if not something is wrong. On some some WebKit TVs the total video frames is reset if the decoder is reinitialised.
818+
818819
if(isVideoFramesNotAdvancing){
819820
if((timeAtLastPlaybackProgress + settings.get().streaming.buffer.videoFramesNotAdvancing.thresholdInSeconds < event.time) && !videoFramesNotAdvancingTriggered){
820821
eventBus.trigger(Events.PLAYBACK_FROZEN,{cause:'Frames have stopped advancing, Chromium bug #41243192', totalVideoFrames: playbackQuality.totalVideoFrames, time: event.time });

0 commit comments

Comments
 (0)