Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Sparacio committed Jun 7, 2016
1 parent a9d3bfc commit dfbc386
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/streaming/controllers/AbrController.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const ABANDON_LOAD = 'abandonload';
const ALLOW_LOAD = 'allowload';
const DEFAULT_VIDEO_BITRATE = 1000;
const DEFAULT_AUDIO_BITRATE = 100;
const QUALITY_DEFAULT = -1;
const QUALITY_DEFAULT = 0;

function AbrController() {

Expand Down
16 changes: 8 additions & 8 deletions src/streaming/controllers/BufferController.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ function BufferController(config) {
clearBufferTimeout;

function setup() {
requiredQuality = -1;
currentQuality = -1;
requiredQuality = AbrController.QUALITY_DEFAULT;
currentQuality = AbrController.QUALITY_DEFAULT;
isBufferingCompleted = false;
bufferLevel = 0;
bufferTarget = 0;
criticalBufferLevel = Number.POSITIVE_INFINITY;
maxAppendedIndex = -1;
lastIndex = -1;
maxAppendedIndex = 0;
lastIndex = 0;
buffer = null;
bufferState = BUFFER_EMPTY;
wallclockTicked = 0;
Expand Down Expand Up @@ -713,10 +713,10 @@ function BufferController(config) {

criticalBufferLevel = Number.POSITIVE_INFINITY;
bufferState = BUFFER_EMPTY;
currentQuality = -1;
lastIndex = -1;
maxAppendedIndex = -1;
requiredQuality = 0;
currentQuality = AbrController.QUALITY_DEFAULT;
requiredQuality = AbrController.QUALITY_DEFAULT;
lastIndex = 0;
maxAppendedIndex = 0;
appendedBytesInfo = null;
appendingMediaChunk = false;
isBufferingCompleted = false;
Expand Down
6 changes: 5 additions & 1 deletion src/streaming/controllers/ScheduleController.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ function ScheduleController(config) {
bufferLevelRule,
nextFragmentRequestRule,
scheduleWhilePaused,
initialQualityChange,
qualityChangeInProgress,
renderTimeCheckInterval;

function setup() {
qualityChangeInProgress = false;
initialPlayback = true;
initialQualityChange = true;
isStopped = false;
playListMetrics = null;
playListTraceMetrics = null;
Expand Down Expand Up @@ -275,9 +277,11 @@ function ScheduleController(config) {
throw new Error('Unexpected error! - currentRepresentationInfo is null or undefined');
}

if (e.oldQuality !== AbrController.QUALITY_DEFAULT) { //blocks init quality change
if (!initialQualityChange) { //blocks init quality change
qualityChangeInProgress = true;
eventBus.trigger(Events.QUALITY_CHANGE_START, {mediaType: e.mediaType, newQuality: e.newQuality, oldQuality: e.oldQuality});
} else {
initialQualityChange = false;
}

clearPlayListTraceMetrics(new Date(), PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON);
Expand Down

0 comments on commit dfbc386

Please sign in to comment.