rutgersc / m3u8-rs

m3u8 parser for rust
MIT License
99 stars 27 forks source link

Make target duration a u64 #68

Closed Orange-Murker closed 9 months ago

Orange-Murker commented 1 year ago

Unlike the segment duration in EXTINF, EXT-X-TARGETDURATION can only be a decimal-integer according to the RFC. The motivation behind this issue is that players can refuse playback if the user of the library sets this to a non-integer value and it is better to eliminate the possibility of this happening.

vagetman commented 1 year ago
   #EXT-X-TARGETDURATION:<s>

   where s is a decimal-integer indicating the Target Duration in
   seconds. 

Makes sense to me

vagetman commented 1 year ago

It's currently defined as f32

https://github.com/rutgersc/m3u8-rs/blob/b9cf88b7ec4294a7a8a8b1ae75ff2673f167b14d/src/parser.rs#L344-L347

rutgersc commented 9 months ago

There are probably users who ingest floaty TARGETDURATIONs that will now fail to parse, but we'll see.