mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Speed up playback by avoiding unnecessary seek when playing from the beginning of a file.
This commit is contained in:
parent
a3c63b4e05
commit
2e492e4d44
1 changed files with 6 additions and 3 deletions
|
@ -580,10 +580,13 @@ impl PlayerInternal {
|
||||||
|
|
||||||
let mut decoder = VorbisDecoder::new(audio_file).unwrap();
|
let mut decoder = VorbisDecoder::new(audio_file).unwrap();
|
||||||
|
|
||||||
|
if position != 0 {
|
||||||
|
info!("seek {}", position);
|
||||||
match decoder.seek(position) {
|
match decoder.seek(position) {
|
||||||
Ok(_) => (),
|
Ok(_) => (),
|
||||||
Err(err) => error!("Vorbis error: {:?}", err),
|
Err(err) => error!("Vorbis error: {:?}", err),
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
info!("Track \"{}\" loaded", track.name);
|
info!("Track \"{}\" loaded", track.name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue