Commit graph

158 commits

Author SHA1 Message Date
Roderick van Domburg 37794c5b78
Merge branch 'new-api' into dev 2022-07-29 23:39:06 +02:00
Roderick van Domburg 6537c441c3
Update Cargo.lock 2022-07-29 22:05:10 +02:00
Roderick van Domburg 05b9b13cf8
Merge branch 'dev' into new-api and update crates 2022-07-27 23:31:11 +02:00
Roderick van Domburg 88e64bd884
Update Cargo.lock 2022-05-23 21:43:16 +02:00
Roderick van Domburg 8ad5a78bf6
Add repository URL 2022-05-21 22:51:30 +02:00
Roderick van Domburg dff19377fa
Update version numbers to 0.4.0 2022-05-21 22:31:15 +02:00
Roderick van Domburg 1290ee9925
Fix clippy warnings 2022-04-07 22:32:43 +02:00
Roderick van Domburg 44860f4738
Remove assertions for what we know works well 2022-01-25 20:58:39 +01:00
Roderick van Domburg 7fe13be564
Fix audio file streaming 2022-01-14 23:24:43 +01:00
Roderick van Domburg 0cc4466245
Improve range checks 2022-01-13 21:15:27 +01:00
Roderick van Domburg ab67370dc8
Improve checking of download chunks 2022-01-13 21:03:09 +01:00
Roderick van Domburg 8d8d6d4fd8
Fail opening the stream for anything but HTTP 206 2022-01-12 22:22:44 +01:00
Roderick van Domburg 0b7ccc803c
Fix streaming on slow connections 2022-01-11 23:45:20 +01:00
Roderick van Domburg 42455e0cdd
Merge branch 'new-api' of github.com:librespot-org/librespot into new-api 2022-01-08 23:29:57 +01:00
Roderick van Domburg f202f364c9
Update tempfile 2022-01-08 21:27:45 +01:00
Roderick van Domburg 5cc3040bd8
Update futures 2022-01-08 21:21:31 +01:00
Roderick van Domburg 89a5133bd7
Upgrade aes-ctr to latest aes 2022-01-08 20:51:51 +01:00
Roderick van Domburg 62ccdbc580
Improve performance of getting/setting download mode 2022-01-07 11:38:24 +01:00
Roderick van Domburg 8d74d48809
Audio file seeking improvements
- Ensure there is enough disk space for the write file
- Switch streaming mode only if necessary
- Return `Err` on seeking errors, instead of exiting
- Use the actual position after seeking
2022-01-06 21:55:08 +01:00
Roderick van Domburg 1a7c440bd7
Improve lock ordering and contention 2022-01-05 20:44:08 +01:00
Roderick van Domburg 5c2b5a21c1
Fix audio file caching 2022-01-05 16:43:46 +01:00
Roderick van Domburg 3e09eff906
Improve initial loading time
- Configure the decoder according to Spotify's metadata, don't probe

- Return from `AudioFile::open` as soon as possible, with the smallest
  possible block size suitable for opening the decoder, so the UI
  transitions from loading to playing/paused state. From there,
  the regular prefetching will take over.
2022-01-04 23:23:20 +01:00
Roderick van Domburg 7921f23927
Improve format handling and support MP3
- Switch from `lewton` to `Symphonia`. This is a pure Rust demuxer
  and decoder in active development that supports a wide range of
  formats, including Ogg Vorbis, MP3, AAC and FLAC for future HiFi
  support. At the moment only Ogg Vorbis and MP3 are enabled; all
  AAC files are DRM-protected.

- Bump MSRV to 1.51, required for `Symphonia`.

- Filter out all files whose format is not specified.

- Not all episodes seem to be encrypted. If we can't get an audio
  key, try and see if we can play the file without decryption.

- After seeking, report the actual position instead of the target.

- Remove the 0xa7 bytes offset from `Subfile`, `Symphonia` does
  not balk at Spotify's custom Ogg packet before it. This also
  simplifies handling of formats other than Ogg Vorbis.

- When there is no next track to load, signal the UI that the
  player has stopped. Before, the player would get stuck in an
  infinite reloading loop when there was only one track in the
  queue and that track could not be loaded.
2022-01-03 00:13:28 +01:00
Roderick van Domburg 286a031d94
Always seek to starting position 2021-12-30 21:52:15 +01:00
Roderick van Domburg 9b6e02fa0d
Prevent a few potential panics 2021-12-29 23:15:08 +01:00
Roderick van Domburg e51f475a00
Further initial loading improvements
This should fix remaining cases of a client connecting, and failing
to start playback from *beyond* the beginning when `librespot` is
still loading that track.

This undoes the `suppress_loading_status` workaround from #430,
under the assumption that the race condition reported there has
since been fixed on Spotify's end.
2021-12-29 22:27:31 +01:00
Roderick van Domburg 332f9f04b1
Fix error hitting play when loading
Further changes:

 - Improve some debug and trace messages

 - Default to streaming download strategy

 - Synchronize mixer volume on loading play

 - Use default normalisation values when the file position isn't
   exactly what we need it to be

 - Update track position only when the decoder reports a
   successful seek
2021-12-28 23:46:37 +01:00
Roderick van Domburg 0f78fc277e
Call stream_from_cdn with CdnUrl 2021-12-27 21:42:57 +01:00
Roderick van Domburg 8aa23ed0c6
Drop locks as soon as possible 2021-12-27 00:11:07 +01:00
Roderick van Domburg b4f7a9e35e
Change to parking_lot and remove remaining panics 2021-12-26 23:02:02 +01:00
Roderick van Domburg 62461be1fc
Change panics into Result<_, librespot_core::Error> 2021-12-26 21:18:42 +01:00
Roderick van Domburg a297c68913
Make ping estimation less chatty 2021-12-19 00:14:00 +01:00
Roderick van Domburg 0d51fd43dc
Remove unwraps from librespot-audio 2021-12-18 23:44:13 +01:00
Roderick van Domburg d18a0d1803
Fix caching message when cache is disabled 2021-12-18 14:02:28 +01:00
Roderick van Domburg 9d88ac59c6
Configure User-Agent once 2021-12-18 13:39:41 +01:00
Roderick van Domburg 3b07a6bcb9
Support user-defined temp directories 2021-12-17 20:58:05 +01:00
Roderick van Domburg 2f7b9863d9
Implement CDN for audio files 2021-12-16 22:42:37 +01:00
Roderick van Domburg f3bb679ab1
Rid of the last remaining clippy warnings 2021-12-08 21:00:42 +01:00
Roderick van Domburg 9b2ca1442e
Move FileId out of SpotifyId 2021-12-08 19:53:45 +01:00
Roderick van Domburg f03a7e95c1
Merge remote-tracking branch 'librespot-org/dev' into new-api-wip 2021-12-08 19:11:53 +01:00
Roderick van Domburg 0e6b1ba9dc
Update version numbers to 0.3.1 2021-10-24 20:12:33 +02:00
Sasha Hilton 6a3377402a Update version numbers to 0.3.0 2021-10-13 15:10:18 +01:00
Roderick van Domburg 949ca4fded
Add and default to "auto" normalisation type (#844) 2021-09-20 19:22:02 +02:00
Roderick van Domburg b016b69772
Fix clippy warnings 2021-09-01 21:25:32 +02:00
Roderick van Domburg 7cd1b7a26a
Merge branch 'dev' into new-api-client 2021-06-26 00:14:20 +02:00
Roderick van Domburg 0703630041
Use PacketType instead of hex identifiers 2021-06-22 23:57:38 +02:00
Roderick van Domburg ad19b69bfb
Various code improvements (#777)
* Remove deprecated use of std::u16::MAX
* Use `FromStr` for fallible `&str` conversions
* DRY up strings into constants
* Change `as_ref().map()` into `as_deref()`
* Use `Duration` for time constants and functions
* Optimize `Vec` with response times
* Move comments for `rustdoc` to parse
2021-05-31 22:32:39 +02:00
johannesd3 555274b5af
Move decoder to playback crate 2021-05-11 20:36:53 +02:00
Sasha Hilton 2ef3928691 Update version numbers to 0.2.0 2021-05-04 13:05:13 +01:00
johannesd3 4925adb4f1 Fix broken streaming mode 2021-04-21 11:26:49 +02:00