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
|
let key = self
|
||||||
.session
|
.session
|
||||||
.audio_key()
|
.audio_key()
|
||||||
.request(track.id, file_id)
|
.request(track.id, file_id);
|
||||||
.wait()
|
let encrypted_file = AudioFile::open(&self.session, file_id);
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
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 mut decrypted_file = AudioDecrypt::new(key, encrypted_file);
|
||||||
|
|
||||||
let normalisation_factor = match NormalisationData::parse_from_file(&mut decrypted_file) {
|
let normalisation_factor = match NormalisationData::parse_from_file(&mut decrypted_file) {
|
||||||
|
@ -580,9 +580,11 @@ impl PlayerInternal {
|
||||||
|
|
||||||
let mut decoder = VorbisDecoder::new(audio_file).unwrap();
|
let mut decoder = VorbisDecoder::new(audio_file).unwrap();
|
||||||
|
|
||||||
match decoder.seek(position) {
|
if position != 0 {
|
||||||
Ok(_) => (),
|
match decoder.seek(position) {
|
||||||
Err(err) => error!("Vorbis error: {:?}", err),
|
Ok(_) => (),
|
||||||
|
Err(err) => error!("Vorbis error: {:?}", err),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info!("Track \"{}\" loaded", track.name);
|
info!("Track \"{}\" loaded", track.name);
|
||||||
|
|
Loading…
Reference in a new issue