RustAudio / lewton

Rust vorbis decoder
Other
261 stars 26 forks source link

get_last_absgp may not work properly for chained streams #87

Open TonalidadeHidrica opened 3 years ago

TonalidadeHidrica commented 3 years ago

As far as I can read from the specs, in an ogg files that has multiple chained logical streams, there is no guarantee that the absolute granule position for all streams are monotonically increasing. That is, after the first stream ends with the granule position 1000, the next stream may start at granule position -100 or something. Performing binary search on such files does not behave properly, and therefore we cannot seek to the right position.

How can we solve this problem? There are several ideas:

est31 commented 3 years ago

The second idea is the best, I'm not so sure whether I want the third idea as this cache has unbounded size.