Skip to content

Commit

Permalink
feat(DASH): Disable xlink processing by default (#7264)
Browse files Browse the repository at this point in the history
Since xlink processing is slow and very few streams use it, it is best
to disable this functionality by default to improve performance
especially on STB or SmartTV devices.
  • Loading branch information
avelad authored Sep 5, 2024
1 parent 9cf6210 commit d5ed8ed
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
9 changes: 8 additions & 1 deletion demo/common/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,14 @@ shakaAssets.testAssets = [
.addFeature(shakaAssets.Feature.MP4)
.addFeature(shakaAssets.Feature.WEBM)
.addFeature(shakaAssets.Feature.XLINK)
.addFeature(shakaAssets.Feature.OFFLINE),
.addFeature(shakaAssets.Feature.OFFLINE)
.setExtraConfig({
manifest: {
dash: {
disableXlinkProcessing: false,
},
},
}),
// From: http://dig.ccmixter.org/files/JeffSpeed68/53327
// Licensed under Creative Commons BY-NC 3.0.
// Free for non-commercial use with attribution.
Expand Down
2 changes: 1 addition & 1 deletion externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ shaka.extern.xml.Node;
* @property {boolean} disableXlinkProcessing
* If true, xlink-related processing will be disabled.
* <br>
* Defaults to <code>false</code>.
* Defaults to <code>true</code>.
* @property {boolean} xlinkFailGracefully
* If true, xlink-related errors will result in a fallback to the tag's
* existing contents. If false, xlink-related errors will be propagated
Expand Down
2 changes: 1 addition & 1 deletion lib/util/player_configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ shaka.util.PlayerConfiguration = class {
dash: {
clockSyncUri: '',
ignoreDrmInfo: false,
disableXlinkProcessing: false,
disableXlinkProcessing: true,
xlinkFailGracefully: false,
ignoreMinBufferTime: false,
autoCorrectDrift: true,
Expand Down
6 changes: 5 additions & 1 deletion test/dash/dash_parser_manifest_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,11 @@ describe('DashParser Manifest', () => {
shaka.util.Error.Severity.CRITICAL,
shaka.util.Error.Category.MANIFEST,
shaka.util.Error.Code.DASH_UNSUPPORTED_XLINK_ACTUATE);
await Dash.testFails(source, error);

const config = shaka.util.PlayerConfiguration.createDefault().manifest;
config.dash.disableXlinkProcessing = false;

await Dash.testFails(source, error, config);
});

it('failed network requests', async () => {
Expand Down
7 changes: 6 additions & 1 deletion test/test/util/dash_parser_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,17 @@ shaka.test.Dash = class {
*
* @param {string} manifestText
* @param {!shaka.util.Error} expectedError
* @param {?shaka.extern.ManifestConfiguration=} config
* @return {!Promise}
*/
static async testFails(manifestText, expectedError) {
static async testFails(manifestText, expectedError, config) {
const manifestData = shaka.util.StringUtils.toUTF8(manifestText);
const dashParser = shaka.test.Dash.makeDashParser();

if (config) {
dashParser.configure(config);
}

const networkingEngine = new shaka.test.FakeNetworkingEngine()
.setResponseValue('dummy://foo', manifestData);

Expand Down

0 comments on commit d5ed8ed

Please sign in to comment.