ejurgensen
ec66f95269
[misc] PR #1941 adjustments
2025-11-12 21:29:50 +01:00
Brad Keifer
9c8728f10f
Move calls to thread_setname() into the thread start routines and move to a single argument thread_setname()
2025-11-09 18:52:35 +11:00
Brad Keifer
28528abbcd
Initial changes to support systems with single arg pthread_setname_np()
2025-11-05 11:36:37 +11:00
ejurgensen
a84f4e09a0
[misc] Prevent OwnTone from hanging when a connection can't be made
...
This change adds a default 3s timeout to net_connect().
Fixes #1916
2025-08-23 17:22:18 +02:00
Christian Meffert
5fec4bbe34
[logger] Add thread name and thread id to log messages
2025-02-16 23:51:06 +01: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
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
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
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
4d0c297901
[evhtr] Consolidate pool threading in evthr.c
...
Also reinstate check for server already running
2023-03-07 21:01:10 +01:00
ejurgensen
74f1b93b42
[httpd] Make http modules agnostic to evhttp
2023-03-07 21:01:10 +01:00
ejurgensen
2e31a3d4f3
[misc] 'unsigned short' instead of 'short unsigned' as arg to net_evhttp_bind()
2023-03-07 21:01:10 +01:00
ejurgensen
3754871c73
[misc] Add utility function to get interface name from IP address
2022-07-14 21:12:58 +02:00
ejurgensen
d2f4efa1bf
[misc] Centralize thread naming plus name websocket thread
2021-07-05 21:40:31 +02:00
ejurgensen
c1db4d914f
[http] Also allow remote playlists to have https streams ( fixes #1251 )
...
Fix it by adding net_is_http_or_https() utility function in misc.h and make
sure it used whenever a http protocol check is made.
2021-05-19 22:53:25 +02:00
ejurgensen
790c9dcca9
[misc] Define SOCK_NONBLOCK and SOCK_CLOEXEC if platform doesn't
2021-04-01 01:45:09 +02:00
ejurgensen
11151affbd
[misc] Add net_evhttp_bind() for centralizing libevent based binding
2021-03-31 23:55:25 +02:00
ejurgensen
dfc1580f13
[misc] Add logging of net_connect() service
2021-03-31 23:55:25 +02:00
ejurgensen
7871d71a9c
[misc] Add utility network functions, incl configurable addr binding
...
Also make misc.c/h a bit less messy.
2021-03-31 23:55:25 +02:00
ejurgensen
ef0f41dc46
[airplay] Separate naming of AirPlay 1 and 2, incl log domains
2021-01-10 15:05:21 +01:00
ejurgensen
cd9fa019dd
[misc] Add NTOSTR() macro
...
Get the string value of a number definition
2020-11-18 23:13:00 +01:00
ejurgensen
d86ca1176d
[misc] Add an in-place string replacement function
2020-02-23 20:30:35 +01:00
whatdoineed2do/Ray
554799ebc3
[streaming/xcode] configurable MP3 streaming bitrate
2019-09-22 22:58:32 +02:00
ejurgensen
1752901529
[misc] Change b64_* to wrap ffmpeg's base64 encoder/decoder
...
Using ffmpeg's is probably better than having our own, plus it provides us with
decoded length, which we will need to support artwork via pipe.
2019-09-20 21:47:17 +02:00
ejurgensen
b3bfb0a5f6
[db] Move calculation of artist/album id's from sqlite to code
...
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.
2019-05-17 23:03:05 +02:00
ejurgensen
02cd65a992
[alsa] New resample-based sync correction
2019-04-08 00:50:20 +02:00
ejurgensen
53780a7ef3
[xcode] Make sample rate + channels variable
...
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.
2019-04-02 22:47:11 +02:00
ejurgensen
19694ee1dd
[misc] Add ringbuffer utility to misc.c/misc.h
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
cee740ae51
[misc] Move MIN() macro from raop.c to misc.c
2019-03-18 23:06:08 +01:00
ejurgensen
462d787fab
[misc] Add media_quality struct for storing sample rate, bps and channels
2019-03-18 23:06:08 +01:00
chme
b000803fe3
[misc] Add compiler hint to check format parameters
2019-01-26 10:08:11 +01:00
ejurgensen
fc5a66f86d
[misc] New utility functions: trim, atrim and safe_snprintf_cat
2018-12-31 15:55:49 +01:00
ejurgensen
16e375e637
[db/misc] Cast ARRAY_SIZE to unsigned (avoids compiler warnings)
2018-09-04 20:07:05 +02:00
chme
66bdb7c0a9
[db] Add function to get a human readable string for data and media kind
2018-03-14 19:21:57 +01:00
ejurgensen
a6fab4ac0d
[httpd/mpd] Adjustments to commit #69ff42f
2017-11-15 23:13:20 +01:00
chme
5d5ed42749
[main/misc] Add misc-function to retrieve enabled buildoptions
2017-09-15 07:01:53 +02:00
chme
14877a49e0
[misc] Replace m_realpath with realpath from stdlib.h
2017-08-12 13:35:22 +02:00
ejurgensen
283df8aa72
[misc] Consolidate control file reader (e.g. for pairing credentials) into misc.c
...
- also remove requirement to enter device name in .remote file
2017-06-14 23:49:18 +02:00
ejurgensen
1aa8072e68
[misc] Change name of string_printf to safe_asprintf
2017-05-05 20:00:51 +02:00
ejurgensen
dcf75f59eb
Merge branch 'string_printf' of git://github.com/chme/forked-daapd into chme-string_printf
2017-05-05 19:43:17 +02:00
ejurgensen
497ffc2f43
[misc] Add __attribute__((__noreturn__)) to our abort functions so
...
scan-build doesn't complain about logic errors after abort
2017-05-05 19:41:17 +02:00
chme
4e6b78ca29
[misc] Add string_printf function
2017-05-01 10:21:57 +02:00
ejurgensen
40d50d693b
[misc] Add small function to swap pointers
2017-01-27 22:36:00 +01:00
ejurgensen
6db4e40119
[misc] Add function to add a relative time to current clock
2017-01-27 22:34:15 +01:00
ejurgensen
c50b038397
[misc] Move STOB and BTOS macros to misc.h
2017-01-27 22:01:24 +01:00
Scott Shambarger
6f7355dfce
Merge branch 'fixthreads' into fixosx
2017-01-21 10:38:47 -05:00
sshambar
b128271656
Merge branch 'master' into fixthreads
2017-01-21 10:27:26 -05:00
Scott Shambarger
8e3797ec43
[threads] Update mutex/cond functions to use new CHECK_ERR macros
...
Added various macros to check return values and log any errors and abort
if the call fails.
Updated logging to handle early errors before logging initialized.
2017-01-21 07:11:20 -08:00
Scott Shambarger
bb68d59a6e
[osx] Added missing timer/clock functions, support Bonjour mDNS on OSX
...
Added configure checks needed to detect missing functions on OSX
Added compat clock functions using clock_get_time on OSX
Added compat timer functions using clock_gettime and setitimer on OSX
Added byteswap functions on OSX
2017-01-14 00:56:43 -05:00