RustAudio / lewton

Rust vorbis decoder
Other
261 stars 26 forks source link

Document the behavior for multiplexed ogg files #86

Open TonalidadeHidrica opened 4 years ago

TonalidadeHidrica commented 4 years ago

The Vorbis specification states that an ogg/vorbis file may contain chained Vorbis stream, but may not be multiplexed. When a new logical stream starts without the previous stream ends, the current lewton decoder switches to the new stream and discards the remainder of previous stream. Although handling such situation is not required by the situation, it may be better to document the behavior. Also, it may be ideal that users can handle multiplexed stream individually.

TonalidadeHidrica commented 4 years ago

On the other hand, we may simply deny the entire parsing once we encountered a multiplexed stream (return Err after we found the beginning of another stream before the previous stream ends). This behavior is consistent with read_headers, which only accepts three headers aligned in row.