Incorrect handling of emsg events when multiple events arrive simultaneously.
Created by: JoeEyles
Environment
- [NA] The MPD passes the DASH-IF Conformance Tool on https://conformance.dashif.org/
- [NA] The stream has correct Access-Control-Allow-Origin headers (CORS)
-
There are no network errors such as 404s in the browser console when trying to play the stream -
The issue observed is not mentioned on https://github.com/Dash-Industry-Forum/dash.js/wiki/FAQ - [Untested, as the events are not exposed] The issue occurs in the latest reference client on http://reference.dashif.org/dash.js/ and not just on my page
- Link to playable MPD file:
- Dash.js version: 2.9.2
- Browser name/version: NA
- OS name/version: NA
Steps to reproduce
- Please provide clear steps to reproduce your problem
Start a dash stream in which multiple emsg events arrive simultaneously, with different values but the same schemeIdUri. Then dashjs will fire the events in the client application with the wrong values.
For example, the stream sends the following events to arrive simultaneously:
schemeIdUri: uri, value: value1
schemeIdUri: uri, value: value2
Then dashjs will fire the following events in the client application:
schemeIdUri: uri, value: value1
schemeIdUri: uri, value: value1
Or
schemeIdUri: uri, value: value2
schemeIdUri: uri, value: value2
- If the bug is intermittent, give a rough frequency if possible When simultaneous events arrive with different values but the same schemeIdUri dahsjs fires events in the client application with incorrect values.
Observed behaviour
Describe what the player is doing that is unexpected or undesired behaviour. The value in the events fired in the client application are incorrect.
Console output
Paste the contents of the browser console here.
You may need to enable debug logging in dash.js by calling player.getDebug().setLogToBrowserConsole(true) if you are using your own page.
I believe that the issue lies with line 583 of BufferController.js
eventStreams[inbandEvents[i].schemeIdUri] = inbandEvents[i];
and lines 466 and 468 of DashAdapter.js
if (!eventStreams[schemeIdUri]) return null;
event.eventStream = eventStreams[schemeIdUri];
I believe these should read
eventStreams[inbandEvents[i].schemeIdUri + "/" + inbandEvents[i].value] = inbandEvents[i];
if (!eventStreams[schemeIdUri + "/" + value]) return null;
and
event.eventStream = eventStreams[schemeIdUri + "/" + value];
respectively. (Or something similar to differentiate the different kinds of event streams).
I can create a pull request if required?