Commit graph

1568 commits

Author SHA1 Message Date
Roderick van Domburg
dbeeb0f991
Switch from chrono to time 2022-01-14 23:28:09 +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
e627cb4b35
Fix panic when retrying a track that already failed 2022-01-13 21:05:17 +01:00
Roderick van Domburg
ab67370dc8
Improve checking of download chunks 2022-01-13 21:03:09 +01:00
Roderick van Domburg
78216eb6ee
Prevent seek before offset 2022-01-13 19:12:48 +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
32df4a401d
Add configurable client ID and listen for updates 2022-01-12 22:09:57 +01:00
Roderick van Domburg
0b7ccc803c
Fix streaming on slow connections 2022-01-11 23:45:20 +01:00
Roderick van Domburg
c067c1524f
Only notify when we are >= 1 second ahead 2022-01-09 23:04:14 +01:00
Roderick van Domburg
a62c1fea8f
Fix rare panics on out-of-bounds stream position 2022-01-09 22:46:44 +01:00
Roderick van Domburg
75e6441db9
Downgrade for MSRV 1.53 2022-01-09 22:24:34 +01:00
Roderick van Domburg
e69d5a8e91
Fix GStreamer lagging audio on next track
Also: remove unnecessary thread and channel
2022-01-09 22:18:55 +01:00
Roderick van Domburg
d2c377d14b
Fix GStreamer cleanup on exit 2022-01-09 16:53:57 +01:00
Roderick van Domburg
59d00787c9
Update player crates and transitive dependencies 2022-01-09 16:04:53 +01:00
Roderick van Domburg
fbff879f3d
Update http, once_cell, vergen 2022-01-09 01:03:47 +01:00
Roderick van Domburg
56f3c39fc6
Update hmac, pbkdf2, serde, serde_json, sha-1 2022-01-09 00:25:47 +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
5a8bd5703c
Update tokio and hyper-rustls 2022-01-08 23:28:46 +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
d380f1f040
Simplify AudioPacketPosition 2022-01-07 11:13:23 +01:00
Roderick van Domburg
a33014f9c5
Notify track position after skipping malformed packets 2022-01-06 22:46:50 +01:00
Roderick van Domburg
67ae0fcf8d
Fix gapless playback 2022-01-06 22:11:53 +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
6c25fb79dc
Merge pull request #925 from pdeljanov/new-api-symphonia-fixes
Handle reset and decode errors
2022-01-06 11:10:02 +01:00
Roderick van Domburg
c1965198fc
Move DeviceType to core 2022-01-06 09:48:11 +01:00
Roderick van Domburg
4ca1f661d5
Prevent deadlock 2022-01-06 09:43:50 +01:00
Philip Deljanov
5d44f910f3 Handle format reset and decode errors.
This change fixes two issues with the error handling of the
Symphonia decode loop.

1) `Error::ResetRequired` should always be propagated to jump
    to the next Spotify track.

2) On a decode error, get a new packet and try again instead of
   propagating the error and jumping to the next track.
2022-01-05 18:17:33 -05:00
Roderick van Domburg
cc9a574b2e
Move ConnectConfig to connect 2022-01-05 21:15:19 +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
eabdd79275
Seeking, buffer size and error handing improvements
- Set ideal sample buffer size after decoding first full packet
- Prevent audio glitches after seeking
- Reset decoder when the format reader requires it

Credits: @pdeljanov
2022-01-04 21:23:53 +01:00
Roderick van Domburg
a49bcb70a7
Fix clippy lints 2022-01-04 21:22:52 +01:00
Roderick van Domburg
8dbcda6bc2
Merge branch 'dev' into new-api 2022-01-04 01:13:48 +01:00
Roderick van Domburg
d5a4be4aa1
Optimize fallback sample buffer size 2022-01-04 00:50:45 +01:00
Roderick van Domburg
01448ccbe8
Seek in milliseconds and report the actual new position 2022-01-04 00:17:30 +01:00
Roderick van Domburg
f3a66d4b99
Remove lewton decoder 2022-01-03 22:41:54 +01:00
Roderick van Domburg
92b8476645
Merge pull request #922 from JasonLG1979/cleanup_list_compatible_devices
Clean up `list_compatible_devices`
2022-01-03 22:32:22 +01:00
Roderick van Domburg
096269c1d0
Reintroduce offset for passthrough decoder 2022-01-03 22:20:29 +01:00
Roderick van Domburg
84e3fe5558
Bump MSRV to 1.53 2022-01-03 01:01:29 +01:00
Roderick van Domburg
60d78b6b58
Bump MSRV to 1.51 2022-01-03 00:44:41 +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
JasonLG1979
8dfa00d66f Clean up list_compatible_devices
Fix a typo and be a little more forgiving.
2022-01-01 17:19:12 -06:00
Roderick van Domburg
2d699e288a
Follow autoplay client setting 2022-01-01 20:23:21 +01:00
Roderick van Domburg
9202ec01d4
Merge pull request #920 from gdesmott/write-own
Sink: pass ownership of the packet on write()
2022-01-01 17:00:03 +01:00
Guillaume Desmottes
f09be4850e Sink: pass ownership of the packet on write()
Prevent a copy if the implementation needs to keep the data around.
2021-12-31 13:46:35 +01:00