From a3c63b4e055f3ec68432d4a27479bed102e68e9e Mon Sep 17 00:00:00 2001 From: Konstantin Seiler Date: Sat, 9 Mar 2019 19:22:15 +1100 Subject: [PATCH] Speed up loading of files by requesting file and key in parallel. --- playback/src/player.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playback/src/player.rs b/playback/src/player.rs index ab1a8abe..3841e35f 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -561,11 +561,11 @@ impl PlayerInternal { .session .audio_key() .request(track.id, file_id) - .wait() - .unwrap(); + 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) {