4455 Commits

Author SHA1 Message Date
ejurgensen
82a0e77eb6 [config] Keep "cache_path" option but mark as deprecated
So OwnTone will still start if user has previously configured "cache_path"
2024-06-17 23:04:20 +02:00
ejurgensen
7dd34792ea [cache] Multitreaded header encoding 2024-06-17 22:25:20 +02:00
ejurgensen
088c393dd6 [httpd/cache] Misc fixing up 2024-06-17 22:25:20 +02:00
ejurgensen
2d9200fcdf [cache] Try to fix cache thread blocking the rest of the server 2024-06-17 22:25:20 +02:00
ejurgensen
ff2d0b4ab1 [httpd] Check speaker settings to determine DAAP/RSP stream format 2024-06-17 22:25:20 +02:00
ejurgensen
62b42ce354 [misc/player] Introduce output ability to announce supported formats
Also introduce default output format and selected device format, should the
user want another format.

As part of this, change enum player_format in player.h to enum media_format in
misc.h so that it is akin to struct media_quality.

Modify json API to support this.
2024-06-17 22:25:20 +02:00
ejurgensen
9f719ca155 [player/jsonapi/db] Add interface to get and set an output format 2024-06-17 22:25:20 +02:00
ejurgensen
c079df5da7 [cache/config] Refactor cache so daap/artwork/xcode is cached in separate db's
Also change config so that the user can just configure a data directory instead
of complete path to each database.
2024-06-17 22:25:20 +02:00
ejurgensen
2efad1466f [cache] Add support for storing MP4 headers 2024-06-17 22:05:07 +02:00
ejurgensen
4a08644806 [xcode] Change the signature of transcode_setup/transcode_en/decode_setup()
Should make it easier to add/remove parameters without changing all calls to the
functions throughout the code.

Also adds an interface through which to call make_mp4_header().
2024-06-17 22:05:07 +02:00
ejurgensen
9dbec4b99e [misc] Move endianess utils from rtp_common.h to misc.h
So that transcode.c can also use them.
2024-06-17 22:05:07 +02:00
ejurgensen
725419d4ac [xcode] Do without _GNU_SOURCE, MacOS doesn't like it 2024-06-17 22:05:07 +02:00
ejurgensen
aed74fbb8a [xcode] Support for ALAC encoded RSP/DAAP streaming
Also changes WAV encoding to use source quality instead of fixed 44100/16/2.
Sets the default to WAV, since it has the best quality, and doesn't have the
delay that creating an MP4 container for ALAC currently has (TODO prepare
the headers to avoid the delay).

Ref issue #1182 and #1665
2024-06-17 22:05:07 +02:00
ejurgensen
c30f44fd01 [misc] New net_peer_address_is_trusted with cfg set default to "lan"
New default for "trusted_networks" = "lan". This will check peer addresses
against the addresses/netmasks of the interfaces to establish whether the peer
is local.

Fixes #1754
2024-06-16 01:17:11 +02:00
ejurgensen
2219e3ce75 [scan] Fix bug where playlist name isn't updated when m3u/pls file is renamed
Closes #1758
2024-06-12 13:12:37 +02:00
ejurgensen
3af04afa61 [dmap] Change date type to int64, fix for "Integer value too large"
uint32 won't work for dates before the Unix epoch, and int32 won't work after
2038, so let's see if clients can handle int64.

Resolves #1742
2024-06-09 22:20:33 +02:00
ejurgensen
e7459e0576 [mdns] Fix OwnTone not updating speaker addresses on ip change
The fix is to use proto instead of addr->proto when creating the record browser
in browse_resolve_callback(). The rest of the commit is just minor
beautification.

Resolves #1760. The issue seems to be a regression from commit
e7a73551ab59d06256602ebce6961ea8811e7584.
2024-06-04 17:11:45 +02:00
ejurgensen
75b8f06e25 [misc] Replace mxml with libxml2
mxml 4 is binary and source incompatible with 3, and there is no easy way to
stay compatible with both. Not great for a library. So replace with libxml2,
hopefully that is more stable. Also means we can get rid of all the mxml hacks
2024-05-31 23:47:46 +02:00
ejurgensen
2bb97c8e0a [cfg] Change ipv6 default to disabled
There is some issue with OwnTone's Airplay ipv6 implementation so disable ipv6
in the config until it is fixed.

Ref issue #1752
2024-05-20 22:21:00 +02:00
ejurgensen
72454de4ef [jsonapi] Fix boolean value assigned to pointer (from cppcheck) 2024-04-10 22:41:08 +02:00
ejurgensen
677aceccb6 [cast] Add missing include 2024-04-10 22:40:52 +02:00
ejurgensen
1c17231b9e [spotify] Fix some logging inaccuracies 2024-04-05 23:45:08 +02:00
ejurgensen
a8342dc513 [xcode] Fix for ffmpeg 7.0 that wants const in avio_alloc_context's signature
Closes #1743
2024-04-05 22:44:46 +02:00
ejurgensen
945bde7c66 [db] Fix memleak if db backup is enabled but fails
Closes issue #1741
2024-04-03 22:04:39 +02:00
ejurgensen
3e7e03b4c1 [jsonapi] Support /api/search?type=genre like type=composers is supported
Ref. #1735
2024-03-30 22:24:53 +01:00
ejurgensen
9b12618b93 [scan] Fix date_released being set to 0 on platforms with musl
%F for ISO date format is only glibc. May affect other date parsing.

Closes #1730
2024-03-21 21:04:21 +01:00
ejurgensen
bf8e433a0e
[scan] Fix error in debug function 2024-03-20 09:27:30 +01:00
ejurgensen
c293f72846 [httpd] Fix for musl libc not having sys/queue.c (closes #1726) 2024-03-03 22:41:25 +01:00
ejurgensen
49de0240b8 [scan] Remove obsolete comments 2024-03-01 23:37:17 +01:00
ejurgensen
4352f54c11 [scan] Use copy_file_range for Linux/FreeBSD file copy
FreeBSD doesn't seem to actually have copyfile.h
2024-03-01 22:59:23 +01:00
whatdoineed2do
2dc448fa30
[scan/library] Media rating sync (#1681)
Automatically read/write ratings to files in the library, if options read_rating/
write_rating are enabled. Also adds a max_rating so the user can set the rating
scale.

Doesn't sync automatic rating updates, because that could lead to whole-playlist
file rewriting.

Closes #1678 

---------

Co-authored-by: whatdoineed2do/Ray <whatdoineed2do@nospam.gmail.com>
Co-authored-by: ejurgensen <espenjurgensen@gmail.com>
2024-01-24 23:30:02 +01:00
ejurgensen
b4e4583e61 [raop] Remove unused function 2024-01-18 18:18:33 +01:00
ejurgensen
74c82141d4 [artwork] Remove errors in log saying "Source 'stream' returned an error..."
Handler for stream doesn't support URL's with "file:", so ignore any such URLs.
2024-01-12 23:04:59 +01:00
ejurgensen
b6ad73e1fa [xcode] Go back to wav as default format for RSP/DAAP transcoding
But add "prefer_format" config option for mp3, incl. a check for an encoder.
The config option is currently not added to owntone.conf.in, so is undocumented
until decided what to do about possible alac support.
2024-01-01 23:22:30 +01:00
ejurgensen
2871a03aa8 [spotify] Fixup commit 182255c 2024-01-01 17:34:07 +01:00
ejurgensen
61bae6367d [spotify/rtp] Remove some unused functions
Closes #1705
2024-01-01 16:37:15 +01:00
ejurgensen
182255cac8 [spotify] Fix double free on logout or exit
Fixes #1706
2024-01-01 16:33:12 +01:00
ejurgensen
e03120c944 [web] Fix possible invalid read during shutdown
The player may emit a listener event when shutting down, and since websockets
didn't remove it's listener callback it would receive an event despite being
deinitialized. This would lead to an invalid read by lws_cancel_service in
listener_cb().
2023-12-29 17:34:48 +01:00
ejurgensen
c28d108b96 [raop] Fix crash when keys of incorrect length are used for legacy pairing
Happens if the user has paied with Airplay 2, and afterwards activates Airplay 1
for the same device, since the keys in device->auth_keys will then be incorrect
length.

Closes #1703
2023-12-28 13:54:52 +01:00
ejurgensen
2fa80b2fd9 [spotify] Remove logging of "No spotify refresh token found"
Logged every time the web UI is used due to call to /api/spotify and during
initscan, but it isn't an error, it just means the user isn't logged in.

Fixes #1701.
2023-12-22 23:29:40 +01:00
ejurgensen
045edf7c55 [httpd] Replace syscall with gettid, syscall deprecated on MacOS 2023-12-19 22:56:58 +01:00
ejurgensen
a7f44dc3e8 [jsonapi] Fix mistaken call to library_media_save
Only library modules should be calling that function
2023-12-19 21:27:31 +01:00
ejurgensen
f430b71645 [jsonapi] Include info about tracks added to queue (closes issue #1564) 2023-12-17 23:42:57 +01:00
ejurgensen
5ea49c94de [library/db/jsonapi] Refactor adding items to queue via JSON API v2 2023-12-17 23:42:57 +01:00
ejurgensen
1ea90b9445 [library/db/jsonapi] Refactor adding items to queue via JSON API
Reduce code duplication and move database specific stuff from httpd_json.c
to db.c.
2023-12-17 23:42:57 +01:00
ejurgensen
cbfce63f4d [db] Use songalbumid's that are distinct for data_kind
Means the same album won't contain both e.g. Spotify and local tracks, they
will instead be shown as two albums.

Ref issue #1650
2023-12-17 21:12:31 +01:00
ejurgensen
f657780a42 [scan] Fix issue where albums get split
Regression from PR #1655. This reverts the metadata search to the method used
before the PR, so that search is done in the order set by the metadata maps.

This means the songalbumid is set by the tag with the highest precedence, not
just the first one found.

Closes #1696
2023-12-16 00:11:54 +01:00
ejurgensen
85e9b06bca [xcode] Produce correctly sized ALAC frames
With ffmpeg < 6, using av_buffersink_set_frame_size() with the codecs frame
size means we no longer the frame size of 352 that Airplay requires.
2023-12-04 17:26:03 +01:00
ejurgensen
3ee9204ff8 [xcode/daap/rsp] Default transcode to 320 kbps mp3 instead of wav
- Calculate size for both formats (+ move the return to transcode_encode_query)
- Let transcode_needed() decide what format to output
- Determine content-type from transcoding type
- Add transcode-dependent ability to override file metadata in rsp/daap
- Send file size matching format
2023-12-04 17:26:03 +01:00
ejurgensen
f0df3f276f [library] Remove false log warning 2023-11-25 22:07:50 +01:00