Skip to content

Double to long int microseconds fails in HLS #9575

@stevemayhew

Description

@stevemayhew

The HLS Parser converts from a string decimal duration in seconds into long microseconds. Because the conversion passes through a java double type it can result in representation errors.

For example, durations like:

  #EXTINF:4.004,

or

  #EXTINF:2.002,

will come out to less then 2,002,000 microseconds if converted to double and multiplied by C.MICROS_PER_SECOND

Easy fix is to use the BigDecimal class in Java, which avoids all of this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions