Commit Graph

4358 Commits

Author SHA1 Message Date
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
ejurgensen
65c72c484b [misc] Add misc_xml.c to wrap mxml, fixes XML reading of CDATA (et al)
The change removes all direct calls to mxml from the modules that need an XML
parser (lastfm.c, pipe.c, rssscanner.c and httpd_rsp.c).

Even with the help of mxml, reading XML is hard, so a layer is added which
helps deal with stuff like whitespace and CDATA. This should make OwnTone more
resilient to any XML variations it might receive.

The changes fixes issue #1677.
2023-11-12 23:43:38 +01:00
ejurgensen
83ac327d7f [spotify] Don't log error if a playlist is empty
Fixes #1676
2023-10-28 17:38:37 +02:00
ejurgensen
369771bda5 [scan] Handle playlists with Unicode BOM
Closes #1674
2023-10-26 23:03:54 +02:00
ejurgensen
253a699001 [scan] Fix reading of FLAC tags
Regression from PR #1655. Closes #1673.
2023-10-26 22:40:23 +02:00
ejurgensen
e4c47c22b3 [scan] Fix issue where m3u genre doesn't override despite m3u_override = true
Closes #1668
2023-10-21 22:37:34 +02:00
ejurgensen
8796368b01 [scan] Fixup lyrics changes 2023-10-19 23:49:53 +02:00
X-Ryl669
9670f6b079 [httpd] Add fetching lyrics in the JSON api 2023-10-19 23:49:53 +02:00
X-Ryl669
cf8b3ecd3a [db,library] Add support for parsing lyrics and storing them in DB 2023-10-19 23:49:53 +02:00
ejurgensen
d266c8a56f [raop] Make compressed ALAC default, but with a config option
Closes #1656
2023-10-06 21:39:26 +02:00
X-Ryl669
ab790c2880 [mdns] Fix select issue on FreeBSD.
As reported in issue #1654, using select to test for a (non-blocking) connection success crashes on FreeBSD when the number of opened file descriptor is higher than FDSET_SIZE.
Instead of returning with an error in that case, this commit uses poll instead that's not limited to the number of opened file descriptors, preventing an out-of-bound write.
2023-10-02 09:53:06 +02:00
ejurgensen
8528073003 [daap] Fix for use-after-free
Present in 28.7 and 28.8. Closes #1659.

Credit X-Ryl669.
2023-09-30 23:06:09 +02:00
ejurgensen
4662cd4cce [scan] Set consistent return type in check_path_in_directories() 2023-09-27 22:46:13 +02:00
ejurgensen
a9e21dcbfd [main] Add a 'testrun' command line option for Github actions 2023-09-03 21:01:11 +02:00
ejurgensen
3f6c7405ed [spotify] Don't zero pthread lock when resetting credentials 2023-09-03 20:59:45 +02:00
ejurgensen
54c2667aea [misc] Use fcntl+O_NONBLOCK when binding instead of socket+SOCK_NONBLOCK
socket() with SOCK_NONBLOCK (O_NONBLOCK) seems not to be possible on MacOS, it
yields 'Protocol wrong type for socket'. Switch to using fcntl() and O_NONBLOCK
instead, hopefully works better cross-platform.

Closes #1644
2023-09-01 17:13:33 +02:00
ejurgensen
9d092c983b
Merge pull request #1648 from whatdoineed2do/library-overwrite-db-entry-fix 2023-09-01 17:06:44 +02:00
whatdoineed2do/Ray
b9b8ced689 [scan] Handles case for file overwrite/move within library that previously original db entry for overwritten file
Fixes #1645
2023-09-01 09:17:54 +01:00
ejurgensen
447e042953 [raop] Add ALAC end tag to each frame
The missing end tag makes the ffmpeg alac decoder upset and we can't have that

Credit Mike Brady
2023-08-30 21:00:33 +02:00
ejurgensen
4315c73775 [httpd] Fix building on FreeBSD which doesn't have SYS_gettid 2023-08-29 23:50:19 +02:00
ejurgensen
214ef12cb5 [spotify] Fix free of invalid pointer on http request error
Fixes #1643
2023-08-29 20:14:19 +02:00
ejurgensen
941fab9023 [xcode] Circumvent ffmpeg 6 ALAC encoding problem
The default ffmpeg ALAC encoder, "alac", requires fixed frames of size 4096,
but the Airplay 2 implementation feeds it with frames of size 352. Before
ffmpeg 6 this worked, but not any more. Seems a frame size check has been
added.

This commit doesn't fix this, but circumvents the ffmpeg error by modifying the
frame size that ffmpeg checks.

Fixes issue #1640
2023-08-17 23:12:26 +02:00
ejurgensen
7f2e05284b [scan] Read m3u8 playlists like m3u
Fixes #1639
2023-08-15 19:33:50 +02:00
Marek Skrobacki
469fcf6707
[mpd] Sanitize newline characters in ID3 tag values (#1615)
Fixes https://github.com/owntone/owntone-server/issues/1613
2023-08-12 23:57:28 +02:00
ejurgensen
9f67f2d4fd [rss] Use "Unknown genre" instead of "Podcast" if no genre found
If the scanner doesn't set anything the genre will be set to unknown in db.c.

See issue #1618
2023-07-06 14:40:39 +02:00
ejurgensen
f998b1f3dd [streaming] Change how metadata is delivered to http streaming
This gets rid of player locks + the special header file outputs/streaming.h
2023-05-12 22:35:10 +02:00
ejurgensen
6364515fb7 [streaming] Use player_streaming_register() for thread safety
Also means we might be able to drop the special header file for
outputs/streaming.c making it a bit more like a regular output module.
2023-05-11 22:30:36 +02:00
ejurgensen
dedd4a95c2 [player] Add player_streaming_register() and _deregister() 2023-05-11 22:30:36 +02:00
ejurgensen
537012440b [streaming] Fix mp3 streaming not working with ffmpeg 6
ffmpeg 6 requires fixed size frames for the encoder, so this commit refactors
the mp3 streaming to do support that. Also uses outputs_quality_subscribe which
potentially has better performance (e.g. a 48000 sample rate source will only
be resampled once if both airplay and mp3 streaming want 44100), and makes it
easier to create fixed size frames.

Resolves #1601
2023-05-11 22:30:36 +02:00
ejurgensen
701bad466e [outputs] Add helpers for output buffer copy and free 2023-05-11 22:30:36 +02:00
ejurgensen
cd62070fdb [xcode] Add "samples_per_frame" query parameter 2023-05-11 22:30:36 +02:00
ejurgensen
4df644eb3a [mdns] Fix possible deref of null *addr in browse_resolve_callback()
Regression from PR #1599, commit e7a7355

Fixes #1604
2023-05-04 22:39:22 +02:00
ejurgensen
2318739a58 [evrtsp] Proper enum return type for evrtsp_parse_headers + evrtsp_parse_firstline
Fixes compiler warnings
2023-04-25 23:09:25 +02:00
ejurgensen
580ba924a4 [httpd] Remove needless test (always true) 2023-04-25 23:04:44 +02:00
couteau
71d37fc9c7 Ignore ipv6 announcements when ipv6 disabled 2023-04-12 11:23:18 -04:00
couteau
e7a73551ab Allow mixed ipv4/ipv6 mdns 2023-04-11 10:25:07 -04:00
ejurgensen
8013bac725 [artwork] Change search order for pipe artwork ("own" as fallback)
Ref. issue #1591
2023-04-03 22:33:21 +02:00
ejurgensen
9e93e130db [raop] Make txt record comparison case insensitive
Should fix issue with TuneAero for Windows

Closes #1596
2023-03-28 23:09:08 +02:00
lordmyschkin
a4ae747b15 [web] Optionally Show FilePath on Now playing-Page 2023-03-15 22:32:16 +01:00
ejurgensen
c645d570ea [artwork] Also look for "own" artwork for pipes
Closes #1591
2023-03-15 22:08:59 +01:00
ejurgensen
e94838925e [httpd] Change prototype for the close connection callback
Don't include hreq since it isn't fully valid, so caller shouldn't be invited
to dereference it.
2023-03-07 21:01:45 +01:00
ejurgensen
18a80f15dd [httpd] Multithread solution using worker threads instead of httpd threads
Using worker threads instead of httpd threads means that we, not libevent,
decide which requests get handled by which threads. This means that we can
make sure blocking requests (e.g. volume changes) don't get in the way of
realtime(ish) stuff like mp3 streaming.

Includes refactor of httpd_stream_file() since it was a bit of a monster.
2023-03-07 21:01:45 +01:00
ejurgensen
81922e147e [streaming] Fix BSD name collision (pipe) 2023-03-07 21:01:10 +01:00
ejurgensen
a2c63a5bac [httpd] Check for syscall() presence and fix small memleak 2023-03-07 21:01:10 +01:00
ejurgensen
7841e336b3 [main] Make libevent_pthreads non-optional 2023-03-07 21:01:10 +01:00
ejurgensen
e77cb3f94e [streaming] ICY handling using output metadata events/callbacks 2023-03-07 21:01:10 +01:00
ejurgensen
4d0c297901 [evhtr] Consolidate pool threading in evthr.c
Also reinstate check for server already running
2023-03-07 21:01:10 +01:00
ejurgensen
bd6f38282c [httpd] Main commit that adds multithreading to httpd
Also refactor streaming implementation to make it more like an output and to
let the design support multithreading.
2023-03-07 21:01:10 +01:00