Skip to content

EventMessageEncoder encoding wrong duration #9123

Closed
@Reevn

Description

@Reevn

Hi there!

This problem is not specific to any platform or ExoPlayer version.

Problem

I've encountered a problem with how the duration of EventMessages (such as DASH EventStream events) is parsed. Per DASH spec it is valid to omit the duration of an MPD event, which means that the duration is unknown. In that case, this is the current workflow as far as I understand it:

This leads to the following values:

// current behaviour
decodedEventMessage.durationMs // 2481536660

// behaviour I would expect
decodedEventMessage.durationMs // C.TIME_UNSET

For emsg boxes inside the media container the duration is already encoded, but the decoding step does not check if the encoded duration is the value for "unknown duration".

Proposal

The DASH spec section 5.10.3.3.4 says the following:

event_duration provides the duration of event in media presentation time. The timescale is indicated in the timescale field. The value 0xFFFF indicates an unknown duration.

To me it seems that two things need to be adjusted

  • When parsing the MPD, encode a missing duration in MPD events as 0xFFFF/65536 instead of C_TIME_UNSET
  • When decoding an EventMessage, set EventMessage.durationMs to C_TIME_UNSET if the encoded duration is 0xFFFF/65536

With these two changes both In-band and Out-of-band events would work in the same way and expose an unknown duration as C.TIME_UNSET. I guess this can be seen as a breaking change for In-band events or a bug fix for both In-band and Out-of-band events.

I am happy to open up a PR if the proposal makes sense.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions