mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Merge pull request #297 from kaymes/kaymes-faster
Improve playback speed
This commit is contained in:
commit
806a8f2da5
1 changed files with 9 additions and 7 deletions
|
@ -560,12 +560,12 @@ impl PlayerInternal {
|
|||
let key = self
|
||||
.session
|
||||
.audio_key()
|
||||
.request(track.id, file_id)
|
||||
.wait()
|
||||
.unwrap();
|
||||
.request(track.id, file_id);
|
||||
let encrypted_file = AudioFile::open(&self.session, file_id);
|
||||
|
||||
let encrypted_file = AudioFile::open(&self.session, file_id).wait().unwrap();
|
||||
|
||||
let encrypted_file = encrypted_file.wait().unwrap();
|
||||
let key = key.wait().unwrap();
|
||||
let mut decrypted_file = AudioDecrypt::new(key, encrypted_file);
|
||||
|
||||
let normalisation_factor = match NormalisationData::parse_from_file(&mut decrypted_file) {
|
||||
|
@ -580,10 +580,12 @@ impl PlayerInternal {
|
|||
|
||||
let mut decoder = VorbisDecoder::new(audio_file).unwrap();
|
||||
|
||||
if position != 0 {
|
||||
match decoder.seek(position) {
|
||||
Ok(_) => (),
|
||||
Err(err) => error!("Vorbis error: {:?}", err),
|
||||
}
|
||||
}
|
||||
|
||||
info!("Track \"{}\" loaded", track.name);
|
||||
|
||||
|
|
Loading…
Reference in a new issue