Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SeekError::OutOfRange when seeking to timestamp 0 #207

Closed
tesselode opened this issue May 27, 2023 · 1 comment
Closed

SeekError::OutOfRange when seeking to timestamp 0 #207

tesselode opened this issue May 27, 2023 · 1 comment

Comments

@tesselode
Copy link

The following code returns a SeekError::OutOfRange with this audio file:

use std::{error::Error, fs::File};

use symphonia::core::{
	formats::{FormatOptions, SeekMode, SeekTo},
	io::{MediaSourceStream, MediaSourceStreamOptions},
	meta::MetadataOptions,
	probe::Hint,
};

fn main() -> Result<(), Box<dyn Error>> {
	let probe = symphonia::default::get_probe();
	let mss = MediaSourceStream::new(
		Box::new(File::open("test.ogg")?),
		MediaSourceStreamOptions::default(),
	);
	let mut format_reader = probe
		.format(
			&Hint::default(),
			mss,
			&FormatOptions::default(),
			&MetadataOptions::default(),
		)?
		.format;
	let track = format_reader.default_track().unwrap();
	format_reader.seek(
		SeekMode::Accurate,
		SeekTo::TimeStamp {
			ts: 0,
			track_id: track.id,
		},
	)?;

	Ok(())
}

The ogg does have audio, so I don't think this is the correct behavior. I also tried this with mp3, flac, and wav files with the same audio data, and none of them have this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants