-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
The following is a snippet that reads first 30 packets from an ogg file.
use lewton::inside_ogg::OggStreamReader;
use std::io::BufReader;
use std::fs::File;
let reader = BufReader::new(File::open("some_ogg_file.ogg").unwrap());
let mut reader = OggStreamReader::new(reader).unwrap();
dbg!(reader.get_last_absgp());
let mut i = 0;
while let Some(_packet) = reader.read_dec_packet().unwrap() {
dbg!(reader.get_last_absgp());
i += 1;
if i >= 30 {
break;
}
}It is reasonable that get_last_absgp returns None before reading any packet, but the program above actually output 23 Nones, followed by 7 reasonable values. Reading the code, I realized that cur_absgp is never updated for the first stream, but updated for the second and subsequent streams. Is this an intended behaviour, or just a bug?
Metadata
Metadata
Assignees
Labels
No labels