This implementation uses a tmpfile for storage of the artwork, plus it uses
artwork_get() which means that it scales the image as requested by the client.
It also does not create a tmpfile unless we actually receive artwork.
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.
This adds a new settings component for user configurable options that
can be changed through the JSON API.
The settings are stored in the admin db table and not in the conf-file.
Since it is unknown how to do real sync on Chromecast, this commit instead adds
a primitive delay to the stream, so that it is at least somewhat closer to
Airplay/local audio.
Also some cleanup of unused stuff.
* [db,jsonapi] case insensitive directory/file listing
* [jsonapi] file listing of playlist uses same VPATH ordering as per directory and files
* [db,jsonapi] sorting via existing S_VPATH
* [db] replace LOWER with COLLATE NOCASE
pb_suspend() + pb_resume() during track changes made the playback status
incorrect, i.e. pb_session.source_list/playing_now would not match what the
input was actually writing. This attempts to solve it by resetting the
session when pb_suspend() is called, so that the input, input_buffer and
source_list come into sync.
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.
Fixes bugs which were due to incorrect handling of unsigned integer wrap-around:
1. Calling packet_resend() with seqnum + len greater than UINT16_MAX => infinite loop
2. Calling rtp_packet_get() with session->seqnum - seqnum greater than pktbuf_next => wrong packet
This fixes a bug from commit 37ce8dd6 where seek_http (which is called when
pausing playback) for non-seekable streams would return -1, thus signalling
an error, even though it is not. The player would think that the stream
could not be played and then skip to the next item.
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.
For dates that require context (ie today, yesterday, N days ago etc) we want the
underlying SQL to respect the current time when running query; a query that
requests items for 'today' should only find matches for the time it was run.
Current implementation would generated a fixed date (at the time the SMARTPL is
inserted into db) in the playlist table where as this commit understands the
context of the date.
* Fix "clicks" during playback, especially on low buffer size devices
Bug had two causes: Trying to write to the prebuf ringbuffer when it was full
and writing new audio to the device without first having drained the prebuf,
thus writing out of order.
* Use snd_pcm_drain() so alsa doesn't report underrun on playback session end
Removes SNDRV_PCM_IOCTL_SYNC_PTR errors
* Fix missing error check of the return value from snd_pcm_avail (now use snd_pcm_avail_delay)
The previous solution would use subqueries to count the number of items and
streams in each playlist, which means that response time gets pretty slow if
there are many playlists.
This commit also includes a number of lesser db code changes.
Commit b3bfb0a and e1993bc change the triggers and calculation of id's in a way
that is not backwards compatible, so we need to make major schema upgrade.
The purpose of this is to support library backends making their own
calculation of these id's, which is relevant if they have more information
available than just album_artist and album.
This also removes a bunch of sqlite extension code plus some triggers, which
in itself is probably an improvement.
Replace reading_next and reading_prev with a list of sources, so that we can
deal with short tracks, i.e. tracks where reading ends before playback starts.
With short tracks reading ends before playback starts, so event_read_eof comes
before event_play_start, which causes playing_now to point to a null
reading_now.
With this change it will point to a non-null reading_prev, but note that in the
hopefully rare case of multiple short tracks, the playing_now pointer will
still be incorrect.
ffmpeg changed the behaviour of avcodec_default_get_format() so that it picks
AV_PIX_FMT_MONOBLACK instead of AV_PIX_FMT_RGB24 for the png encoder. That
makes the function of no use to us, so now the pix formats are just hardcoded
in the settings instead.
This change is preparation to use ffmpeg's resampling capabilities to keep local
audio in sync (by up/downsampling slightly). This requires that sample rates are
not fixed for a transcode profile.
Added benefit of this is that we don't need quite as many xcode profiles.