Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition error while switching audio tracks #5614

Closed
diogoazevedos opened this issue Sep 7, 2023 · 0 comments · Fixed by #5619
Closed

Race condition error while switching audio tracks #5614

diogoazevedos opened this issue Sep 7, 2023 · 0 comments · Fixed by #5619
Labels
component: DASH The issue involves the MPEG DASH manifest format priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@diogoazevedos
Copy link
Contributor

What version of Shaka Player are you using?
4.4.1

Are you using the demo app or your own custom app?
Custom

If custom app, can you reproduce the issue using our demo app?
Yes

What browser and OS are you using?
Chrome macOS

What are the manifest and license server URIs?
https://player-static-server-assets.mediafe-prd.s.joyn.de/media/vod/multi-audio/dash/manifest.mpd

What did you do?

shakaDemoMain.video_.addEventListener('durationchange', () => shakaDemoMain.player_.selectAudioLanguage('de', 'alternate'))
shakaDemoMain.player_.load('https://player-static-server-assets.mediafe-prd.s.joyn.de/media/vod/multi-audio/dash/manifest.mpd');

The error seems to be caused by a race condition when .release() is called before .createUrisCb():

release() {
super.release();
this.templateInfo_ = null;
// We cannot release other fields, as segment index can
// be recreated using only template info.
}

const createUrisCb = () => {
return shaka.dash.TimelineSegmentIndex
.createUris_(
this.templateInfo_.mediaTemplate,
this.representationId_,
segmentReplacement,
this.bandwidth_,
timeReplacement,
this.baseUris_,
);
};

The issue was introduced via #5061

What did you expect to happen?
The audio track is selected and no error is thrown.

What actually happened?
The audio track is selected and the player throws the error:

TypeError: Cannot read properties of null (reading 'mediaTemplate')
    at shaka.media.SegmentReference.createUrisCb [as getUrisInner] (segment_template.js:873:36)
    at shaka.media.SegmentReference.getUris (segment_reference.js:291:17)
    at shaka.media.StreamingEngine.dispatchFetch_ (streaming_engine.js:2226:19)
    at shaka.media.StreamingEngine.fetch_ (streaming_engine.js:2195:17)
    at shaka.media.StreamingEngine.fetchAndAppend_ (streaming_engine.js:1411:35)
@diogoazevedos diogoazevedos added the type: bug Something isn't working correctly label Sep 7, 2023
@shaka-bot shaka-bot added this to the v4.5 milestone Sep 7, 2023
@avelad avelad added priority: P2 Smaller impact or easy workaround component: DASH The issue involves the MPEG DASH manifest format labels Sep 8, 2023
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Nov 7, 2023
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: DASH The issue involves the MPEG DASH manifest format priority: P2 Smaller impact or easy workaround status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants