Commit Graph

23 Commits

Author SHA1 Message Date
ejurgensen
6f0fef6179 [spotify] Reintroduce libspotify support, change spotifyc to librespot-c
Select use of either libspotify or librespot-c as streaming backend via config
option.

librespot-c (renamed/improved spotifyc) impl has the following:
- sync interface
- seek support
- honor bitrate config, set client and thread name
- use web access token with "streaming" scope for login
- fix issue with podcast playback

Also say goodbye to file-based Spotify login.
2021-05-31 23:24:58 +02:00
ejurgensen
a67c74ba6c [spotify] Introduce own spotifyc as replacement for libspotify 2021-05-31 11:54:30 +02:00
ejurgensen
28df2fb0f9 [input] Extra comment 2020-05-19 23:06:36 +02:00
ejurgensen
360e46683b [input] Add a simple input for testing timing 2020-05-12 22:25:38 +02:00
ejurgensen
e570cbdcbd [player] Use input progress metadata to update clients
Before, we were ignoring progress metadata, and we were also updating clients
and db too early with input metadata (right when read from the input, instead of
waiting until playback (speakers) were at that position.

This change adds a complicated async chain of events from when the update is
received.
2020-05-12 20:16:15 +02:00
ejurgensen
ef9c0117c9 [input] Fix pipe playback bringing cpu to 100%
When pipe playback is started, but no data is written to the pipe, the input
loop would bring the cpu to 100%. This fix limits the loop like it was before
player refactor.
2019-08-28 22:23:11 +02:00
ejurgensen
86339eee87 [input] Make input_resume() not reopen tracks that have finished playing
If playback was paused during the very last part of the track, the rest of the
track would be read into the input buffer and the input would be closed. With
this commit the input will not be reopened.

Also allow input_flush to be called with null argument.
2019-08-17 01:37:39 +02:00
ejurgensen
5307c6d94b [player] Fix commit 3e9f8ef, input_resume() must be non-blocking (possibly issue #773) 2019-07-14 00:02:50 +02:00
ejurgensen
3e9f8effa0 [player] Better fix for resuming playback af long pause (issue #766)
The fix in commit 3928ab6 broke resuming from an underrun, since it meant that
pb_resume() would flush the input buffer. With this fix it is possible to call
input_resume(), which will not flush the buffer if the source is already open.

Also renamed some functions in player.c for consistency.
2019-07-12 19:11:48 +02:00
ejurgensen
ab0a6055b9 [input] Refactor metadata handling + add playback wait timeout
Previously input_metadata_get() would retrieve artwork from the source being
read currently, which might not be the one that triggered the FLAG_METADATA
event. So to fix this the metadata is now read by the input module itself when
the METADATA event happens, and the result is stored with the marker.

The commit also includes a timer so that the input thread does loop forever
if the player never starts reading.

Also some refactoring of metadata + abolish input_metadata_get and
input_quality_get. The latter in an attempt to treat the two in the same way.
2019-03-18 23:06:08 +01:00
ejurgensen
87ca6363ae [player/input] Refactor - WIP
* Open input sources earlier
* Gapless playback
* Remove fixed 44100/16 from player
* Complete restructure player internals
2019-03-18 23:06:08 +01:00
ejurgensen
a9085e978d [input] Change input abstraction to use media_quality instead of input_quality 2019-03-18 23:06:08 +01:00
ejurgensen
1696fc3384 [input] Adapt input_buffer so it can handle dynamic quality (sample rates etc)
Still WIP, player and outputs cannot handle this yet
2019-03-18 23:06:08 +01:00
ejurgensen
9182597605 [input/xcode] Write to input buffer with the sources native sample rate/format
Still WIP at this point since the player and output can't use the use improved
quality yet, and because rtptimes etc. are likely incorrect
2019-03-18 23:06:08 +01:00
ejurgensen
5d74c98431 [input] Pass read errors to the player through the input buffer 2017-03-11 19:23:49 +01:00
ejurgensen
f27fb53caf [input] Rename player source ->xcode to ->input_ctx, because any input may use it, not just transcode 2017-02-08 22:29:37 +01:00
ejurgensen
dc84294348 [input/pipe] Parse basic Shairport metadata using mxml 2017-01-28 22:19:51 +01:00
ejurgensen
7b6a7b65b3 [input] Add interface for getting metadata from input modules 2017-01-27 22:36:00 +01:00
ejurgensen
acc67338a1 [input] Add a buffer full callback for the player 2017-01-27 22:35:15 +01:00
ejurgensen
9aede45a12 [pipe] Add a pipe input with autostart capabilities 2017-01-27 22:30:47 +01:00
ejurgensen
938e197fa4 [player] Refactor read/write
- remove read skip which is obsolete when input has own thread and cannot block
- simplify code
- fix while loop that could loop infinitely
2017-01-27 22:29:08 +01:00
ejurgensen
79639c73ed [input] Add Spotify input module 2017-01-27 22:08:56 +01:00
ejurgensen
3e24f857fa [input] Add input interface to player - WIP 2017-01-27 22:01:24 +01:00