mirror of
https://github.com/video-dev/hls.js.git
synced 2026-06-16 13:34:44 +00:00
Fix uncaught init segment abort errors, remove warning
Fixes internal exceptioin caught by e2e tests: https://github.com/video-dev/hls.js/actions/runs/27314625048/job/80898805659#step:8:361
This commit is contained in:
@@ -601,7 +601,9 @@ export default class BaseStreamController
|
||||
if (this.state === State.STOPPED || this.state === State.ERROR) {
|
||||
return;
|
||||
}
|
||||
this.warn(`Frag error: ${reason?.message || reason}`);
|
||||
this.log(
|
||||
`Frag error ${fragment.type} sn:${fragment.sn} cc:${fragment.cc}: ${reason?.message || reason}`,
|
||||
);
|
||||
this.resetFragmentLoading(fragment);
|
||||
});
|
||||
}
|
||||
@@ -813,7 +815,6 @@ export default class BaseStreamController
|
||||
this.fragmentLoader.abort();
|
||||
this.handleFragLoadError(reason);
|
||||
}
|
||||
this.warn(reason);
|
||||
this.resetFragmentLoading(mediaFrag);
|
||||
throw reason;
|
||||
});
|
||||
@@ -1100,6 +1101,8 @@ export default class BaseStreamController
|
||||
this.log(
|
||||
`Context changed in KEY_LOADING sn: ${frag.sn} ${frag.relurl} > ${this.fragCurrent?.relurl}`,
|
||||
);
|
||||
initDataPromise?.catch(() => null);
|
||||
keyLoadingPromise?.catch(() => null);
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
this.log(
|
||||
|
||||
@@ -965,7 +965,6 @@ describe('BaseStreamController', function () {
|
||||
baseStreamController as any,
|
||||
'resetFragmentLoading',
|
||||
);
|
||||
const warnStub = sinon.stub(baseStreamController as any, 'warn');
|
||||
|
||||
const result = (baseStreamController as any).loadInitSegmentIfNeeded(
|
||||
mediaFrag,
|
||||
@@ -989,13 +988,11 @@ describe('BaseStreamController', function () {
|
||||
expect(resetFragmentLoadingStub).to.have.been.calledOnceWith(
|
||||
mediaFrag,
|
||||
);
|
||||
expect(warnStub).to.have.been.calledOnceWith(loadError);
|
||||
})
|
||||
.finally(() => {
|
||||
abortStub.restore();
|
||||
handleFragLoadErrorStub.restore();
|
||||
resetFragmentLoadingStub.restore();
|
||||
warnStub.restore();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user