Skip to content

Commit d405483

Browse files
Merge pull request #108 from bbc/remove-video-frames-not-advancing
Remove videoFramesNotAdvancing feature
2 parents 11e4952 + 60a050a commit d405483

7 files changed

Lines changed: 4 additions & 111 deletions

File tree

dash.d.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,7 @@ declare namespace dashjs {
988988
stallThreshold?: number,
989989
lowLatencyStallThreshold?: number,
990990
useAppendWindow?: boolean,
991-
setStallState?: boolean
992-
videoFramesNotAdvancing?: {
993-
enabled?: boolean
994-
thresholdInSeconds?: number,
995-
},
991+
setStallState?: boolean
996992
avoidCurrentTimeRangePruning?: boolean
997993
useChangeTypeForTrackSwitch?: boolean
998994
mediaSourceDurationInfinity?: boolean
@@ -1582,7 +1578,6 @@ declare namespace dashjs {
15821578
PLAYBACK_SEEKED: 'playbackSeeked';
15831579
PLAYBACK_SEEKING: 'playbackSeeking';
15841580
PLAYBACK_STALLED: 'playbackStalled';
1585-
PLAYBACK_FROZEN: 'playbackFrozen'
15861581
PLAYBACK_STARTED: 'playbackStarted';
15871582
PLAYBACK_TIME_UPDATED: 'playbackTimeUpdated';
15881583
PLAYBACK_VOLUME_CHANGED: 'playbackVolumeChanged';
@@ -2514,7 +2509,6 @@ declare namespace dashjs {
25142509
CORRUPT_MEDIA_OTHER: 'M01';
25152510
BASE_URL_CHANGED: 'F00';
25162511
BECAME_REPORTER: 'S00';
2517-
PLAYBACK_FROZEN: 'P00';
25182512
}
25192513

25202514
export interface Metrics {
@@ -4318,7 +4312,6 @@ declare namespace dashjs {
43184312
PLAYBACK_SEEKED: 'playbackSeeked';
43194313
PLAYBACK_SEEKING: 'playbackSeeking';
43204314
PLAYBACK_STALLED: 'playbackStalled';
4321-
PLAYBACK_FROZEN: 'playbackFrozen'
43224315
PLAYBACK_STARTED: 'playbackStarted';
43234316
PLAYBACK_TIME_UPDATED: 'playbackTimeUpdated';
43244317
PLAYBACK_WAITING: 'playbackWaiting';

index.d.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -988,11 +988,7 @@ declare namespace dashjs {
988988
stallThreshold?: number,
989989
lowLatencyStallThreshold?: number,
990990
useAppendWindow?: boolean,
991-
setStallState?: boolean
992-
videoFramesNotAdvancing?: {
993-
enabled?: boolean
994-
thresholdInSeconds?: number,
995-
},
991+
setStallState?: boolean
996992
avoidCurrentTimeRangePruning?: boolean
997993
useChangeTypeForTrackSwitch?: boolean
998994
mediaSourceDurationInfinity?: boolean
@@ -1583,7 +1579,6 @@ declare namespace dashjs {
15831579
PLAYBACK_SEEKED: 'playbackSeeked';
15841580
PLAYBACK_SEEKING: 'playbackSeeking';
15851581
PLAYBACK_STALLED: 'playbackStalled';
1586-
PLAYBACK_FROZEN: 'playbackFrozen'
15871582
PLAYBACK_STARTED: 'playbackStarted';
15881583
PLAYBACK_TIME_UPDATED: 'playbackTimeUpdated';
15891584
PLAYBACK_VOLUME_CHANGED: 'playbackVolumeChanged';
@@ -2515,7 +2510,6 @@ declare namespace dashjs {
25152510
CORRUPT_MEDIA_OTHER: 'M01';
25162511
BASE_URL_CHANGED: 'F00';
25172512
BECAME_REPORTER: 'S00';
2518-
PLAYBACK_FROZEN: 'P00';
25192513
}
25202514

25212515
export interface Metrics {
@@ -4319,7 +4313,6 @@ declare namespace dashjs {
43194313
PLAYBACK_SEEKED: 'playbackSeeked';
43204314
PLAYBACK_SEEKING: 'playbackSeeking';
43214315
PLAYBACK_STALLED: 'playbackStalled';
4322-
PLAYBACK_FROZEN: 'playbackFrozen'
43234316
PLAYBACK_STARTED: 'playbackStarted';
43244317
PLAYBACK_TIME_UPDATED: 'playbackTimeUpdated';
43254318
PLAYBACK_WAITING: 'playbackWaiting';

src/core/Settings.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,6 @@ import Events from './events/Events';
109109
* lowLatencyStallThreshold: 0.3,
110110
* useAppendWindow: true,
111111
* setStallState: true,
112-
* videoFramesNotAdvancing: {
113-
* enabled: false
114-
* thresholdInSeconds: 5,
115-
* },
116112
* avoidCurrentTimeRangePruning: false,
117113
* useChangeTypeForTrackSwitch: true,
118114
* mediaSourceDurationInfinity: true,
@@ -360,11 +356,6 @@ import Events from './events/Events';
360356
* @property {module:Settings~SyntheticStallSettings} [syntheticStallEvents]
361357
* Specified if we fire manual stall events once the stall threshold is reached
362358
*
363-
* @property {number} [videoFramesNotAdvancing={enabled:false,thresholdInSeconds:5}]
364-
* 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.
365-
*
366-
* The 'enabled' property signifies whether we attempt to handle the bug should it occur by seeking to the current time.
367-
* The 'thresholdInSeconds' a time in seconds that determines how long the issue must be occuring before the handler is triggered, it can be used to control the sensitivity of the mechanism.
368359
* @property {boolean} [avoidCurrentTimeRangePruning=false]
369360
* Avoids pruning of the buffered range that contains the current playback time.
370361
*
@@ -1003,10 +994,6 @@ function Settings() {
1003994
lowLatencyStallThreshold: 0.3,
1004995
useAppendWindow: true,
1005996
setStallState: true,
1006-
videoFramesNotAdvancing: {
1007-
enabled: false,
1008-
thresholdInSeconds: 5
1009-
},
1010997
avoidCurrentTimeRangePruning: false,
1011998
useChangeTypeForTrackSwitch: true,
1012999
mediaSourceDurationInfinity: true,

src/streaming/MediaPlayerEvents.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,6 @@ class MediaPlayerEvents extends EventsBase {
376376
*/
377377
this.PLAYBACK_STALLED = 'playbackStalled';
378378

379-
/**
380-
* Sent when a stall in playback has occured but the reason for it is unclear.
381-
* @event MediaPlayerEvents#PLAYBACK_FROZEN
382-
*/
383-
this.PLAYBACK_FROZEN = `playbackFrozen`;
384-
385379
/**
386380
* Sent when playback of the media starts after having been paused;
387381
* that is, when playback is resumed after a prior pause event.

src/streaming/controllers/StreamController.js

Lines changed: 2 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function StreamController() {
6363
autoPlay, isStreamSwitchingInProgress, hasMediaError, hasInitialisationError, mediaSource, videoModel,
6464
playbackController, serviceDescriptionController, mediaPlayerModel, customParametersModel, isPaused,
6565
initialPlayback, initialSteeringRequest, playbackEndedTimerInterval, bufferSinks, preloadingStreams,
66-
supportsChangeType, settings, totalVideoFramesAtLastPlaybackProgress, timeAtLastPlaybackProgress, videoFramesNotAdvancingTriggered,
66+
supportsChangeType, settings,
6767
firstLicenseIsFetched, waitForPlaybackStartTimeout, providedStartTime, errorInformation;
6868

6969
function setup() {
@@ -796,78 +796,17 @@ function StreamController() {
796796
}
797797
}
798798
}
799-
800-
/**
801-
* Checks whether the browser environment is WebKit based or not
802-
* @private
803-
*/
804-
function isWebKit() {
805-
return typeof window.webkitConvertPointFromNodeToPage === 'function' || false
806-
}
807-
808-
/**
809-
* Evaluates whether video frames have potentially stopped advancing, added to address https://issues.chromium.org/issues/41243192
810-
* @private
811-
*/
812-
function checkIfVideoFramesNotAdvancing(event) {
813-
814-
const playbackQuality = videoModel.getPlaybackQuality();
815-
816-
if(videoModel.isSeeking()){
817-
totalVideoFramesAtLastPlaybackProgress = 0
818-
}
819-
820-
const isEnded = event.timeToEnd ? event.timeToEnd <= 0 : false;
821-
822-
const isVideoFramesNotAdvancing = !isWebKit()
823-
&& playbackQuality
824-
&& typeof playbackQuality.totalVideoFrames === 'number'
825-
&& !isEnded
826-
&& timeAtLastPlaybackProgress !== 0
827-
&& event.time > settings.get().streaming.buffer.videoFramesNotAdvancing.thresholdInSeconds // We should be at least one threshold into the video before triggering
828-
&& !videoModel.isPaused()
829-
&& !videoModel.isStalled()
830-
&& !videoModel.isSeeking()
831-
&& videoModel.getReadyState() >= Constants.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA
832-
&& playbackQuality.totalVideoFrames > 0 // Handles devices (some TVs), where Video Quality API, totalVideoFrames always returns 0.
833-
&& playbackQuality.totalVideoFrames < 2147483647 //Handles devices, where Video Quality API, totalVideoFrames can return the max value of a 32 bit signed integer becuase the implementation uses totalVideoFrames = mediaTime * framerate.
834-
&& playbackQuality.totalVideoFrames !== playbackQuality.droppedVideoFrames // Handles devices (some TVs), where Video Quality API, totalVideoFrames always equals the number of dropped frames.
835-
&& playbackQuality.totalVideoFrames === totalVideoFramesAtLastPlaybackProgress // Total frames should advance with time progression, if not something is wrong. On some some TVs the total video frames is reset if the decoder is reinitialised.
836-
837-
if(isVideoFramesNotAdvancing){
838-
if((timeAtLastPlaybackProgress + settings.get().streaming.buffer.videoFramesNotAdvancing.thresholdInSeconds < event.time) && !videoFramesNotAdvancingTriggered){
839-
eventBus.trigger(Events.PLAYBACK_FROZEN,{
840-
cause:'Frames have stopped advancing, Chromium bug #41243192',
841-
totalVideoFrames: playbackQuality.totalVideoFrames,
842-
mediaTime: event.time
843-
});
844-
if(settings.get().streaming.buffer.videoFramesNotAdvancing.enabled){
845-
logger.warn('Video playback has frozen, attempting to recover by seeking to current time')
846-
videoModel.setCurrentTime(videoModel.getTime()-0.0001,false)
847-
}
848-
videoFramesNotAdvancingTriggered = true
849-
}
850-
}
851-
else{
852-
timeAtLastPlaybackProgress = event.time
853-
videoFramesNotAdvancingTriggered = false
854-
if(typeof playbackQuality.totalVideoFrames === 'number'){
855-
totalVideoFramesAtLastPlaybackProgress = playbackQuality.totalVideoFrames
856-
}
857-
}
858-
}
859799

860800
/**
861801
* When the playback time is updated we add the droppedFrames metric to the dash metric object
862802
* @private
863803
*/
864-
function _onPlaybackTimeUpdated(event) {
804+
function _onPlaybackTimeUpdated() {
865805

866806
if (hasVideoTrack()) {
867807
const playbackQuality = videoModel.getPlaybackQuality();
868808
if (playbackQuality) {
869809
dashMetrics.addDroppedFrames(playbackQuality);
870-
checkIfVideoFramesNotAdvancing(event)
871810
}
872811
}
873812
}
@@ -1623,9 +1562,6 @@ function StreamController() {
16231562
supportsChangeType = false;
16241563
preloadingStreams = [];
16251564
waitForPlaybackStartTimeout = null;
1626-
totalVideoFramesAtLastPlaybackProgress = 0;
1627-
timeAtLastPlaybackProgress = 0;
1628-
videoFramesNotAdvancingTriggered = false;
16291565
errorInformation = {
16301566
counts: {
16311567
mediaErrorDecode: 0

src/streaming/metrics/utils/DVBErrorsTranslator.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,6 @@ function DVBErrorsTranslator(config) {
8888
});
8989
}
9090

91-
function onPlaybackStallCauseUnknown() {
92-
report({
93-
errorcode: DVBErrors.PLAYBACK_FROZEN
94-
});
95-
}
96-
9791
function handleHttpMetric(vo) {
9892
if ((vo.responsecode === 0) || // connection failure - unknown
9993
(vo.responsecode == null) || // Generated on .catch() and when uninitialized
@@ -149,7 +143,6 @@ function DVBErrorsTranslator(config) {
149143
eventBus.on(Events.METRIC_ADDED, onMetricEvent, instance);
150144
eventBus.on(Events.METRIC_UPDATED, onMetricEvent, instance);
151145
eventBus.on(Events.PLAYBACK_ERROR, onPlaybackError, instance);
152-
eventBus.on(Events.PLAYBACK_FROZEN, onPlaybackStallCauseUnknown, instance);
153146
eventBus.on(
154147
MetricsReportingEvents.BECAME_REPORTING_PLAYER,
155148
onBecameReporter,
@@ -167,7 +160,6 @@ function DVBErrorsTranslator(config) {
167160
eventBus.off(Events.METRIC_ADDED, onMetricEvent, instance);
168161
eventBus.off(Events.METRIC_UPDATED, onMetricEvent, instance);
169162
eventBus.off(Events.PLAYBACK_ERROR, onPlaybackError, instance);
170-
eventBus.off(Events.PLAYBACK_FROZEN, onPlaybackStallCauseUnknown, instance);
171163
eventBus.off(
172164
MetricsReportingEvents.BECAME_REPORTING_PLAYER,
173165
onBecameReporter,

src/streaming/metrics/vo/DVBErrors.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class DVBErrors {
5757
// Corrupt media – Not otherwise specified "M01"
5858
// Changing Base URL in use due to errors "F00"
5959
// Becoming an error reporting Player "S00"
60-
// Playback error has occured, the cause is unknown "P00"
6160

6261
this.terror = null;
6362
// Real-Time - Date and time at which error occurred in UTC,
@@ -94,6 +93,5 @@ DVBErrors.CORRUPT_MEDIA_ISOBMFF = 'M00';
9493
DVBErrors.CORRUPT_MEDIA_OTHER = 'M01';
9594
DVBErrors.BASE_URL_CHANGED = 'F00';
9695
DVBErrors.BECAME_REPORTER = 'S00';
97-
DVBErrors.PLAYBACK_FROZEN = 'P00';
9896

9997
export default DVBErrors;

0 commit comments

Comments
 (0)