Commit Graph

61 Commits

Author SHA1 Message Date
ejurgensen
19694ee1dd [misc] Add ringbuffer utility to misc.c/misc.h 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
ejurgensen
fc5a66f86d [misc] New utility functions: trim, atrim and safe_snprintf_cat 2018-12-31 15:55:49 +01:00
ejurgensen
103dda29f3 [misc] Move CHECK_NULL inside b64_decode (around the malloc)
To stay in line with general use of the macro
2018-12-29 16:39:52 +01:00
chme
f4422e9cf4 [MAKEFILE/misc] Add option to disable inclusion of default webinterface 2018-06-03 23:39:37 +03:00
ejurgensen
a6fab4ac0d [httpd/mpd] Adjustments to commit #69ff42f 2017-11-15 23:13:20 +01:00
ejurgensen
eec98e3b7e [main/transcode] Fix some libav compability + log what ffmpeg/libav we are using 2017-09-16 23:01:42 +02:00
ejurgensen
507bec8b8e [-] Fixup ifdef WEBSOCKET->HAVE_LIBWEBSOCKETS that I missed 2017-09-16 01:25:47 +02:00
chme
2c51c6571a [misc] Add websocket to buildopts 2017-09-15 07:16:41 +02:00
chme
5d5ed42749 [main/misc] Add misc-function to retrieve enabled buildoptions 2017-09-15 07:01:53 +02:00
ejurgensen
c45a85d143 [dacp] Fix issue where Hyperfine Remote provides speaker ids as decimal
Also align a bit on how we handle hex/dec parameters
2017-08-27 00:02:39 +02:00
chme
14877a49e0 [misc] Replace m_realpath with realpath from stdlib.h 2017-08-12 13:35:22 +02:00
ejurgensen
01308f7f83 Misc fixup to keep scan-build happy 2017-06-20 22:07:49 +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
chme
4e6b78ca29 [misc] Add string_printf function 2017-05-01 10:21:57 +02:00
chme
82e216c931 Add missing FALLTHROUGH comments to switch-case statements
This allows to suppress code analysis warnings in IDEs for missing break
statements.
2017-02-26 11:04:04 +01:00
ejurgensen
3a7ed96895 [misc] Adding missing header for non-Posix timer platforms 2017-02-07 23:22:38 +01:00
ejurgensen
c975cf4474 [misc] Set output of safe_xxx to 0 also in error cases (for safety) 2017-01-27 22:36:00 +01: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
36d9051a91 [misc] Fixup coding style 2017-01-22 23:47:45 +01:00
Scott Shambarger
836320518b Merge branch 'master' into fixosx 2017-01-21 13:04:38 -05:00
Scott Shambarger
a837389ac5 Minor change: remove unused include, init variable. 2017-01-21 08:51:51 -08: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
879d9a80aa [osx] Remove incorrect calculations for timer_getoverrun 2017-01-14 23:29:07 -05: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
Scott Shambarger
b54d94fda6 [threads] Added missing initializers, check errors on mutex/cond calls 2017-01-13 17:32:59 -05:00
chme
263edaa8b3 [misc] Helper function safe_strdup (NULL safe strdup) 2017-01-13 18:56:37 +01:00
ejurgensen
bdd6bab982 [-] Lots of housekeeping thanks to scan-build and input from @acmay 2016-11-19 23:08:50 +01:00
ejurgensen
561228d9f7 [misc] Add missing const qualifier 2016-07-31 23:27:57 +02:00
ejurgensen
4c887ba7bb [chromecast] First building blocks for supporting ChromeCast 2016-02-11 20:04:29 +01:00
ejurgensen
6224fdb025 UTF-8 conversion was returning string without null termination (thank you @stephan-01010011, ref pr #168) 2015-06-06 14:22:24 +02:00
stephan-01010011
32727bd296 Fixed bug that caused icy header metadata to be not correctly
encoded/converted. Characters above x7F were replaced by '?' character
although the rfc defines a ISO−8859−1 encoding for descriptive
field-content.

According to rfc2616 the field-content is defined as follows:
<the OCTETs making up the field-value and consisting of either *TEXT or
combinations of token, separators, and quoted-string>
The TEXT rule is only used for descriptive field contents and values
that are not intended to be interpreted by the message parser. Words of
*TEXT MAY contain characters from character sets other than ISO- 8859-1
only when encoded according to the rules of RFC 2047.

In the previous implementation the icy metadata was converted based on
fromcode "ascii".

Following incoming icy header field-values should be encoded as
"ISO−8859−1" before adding them to the metadata structure.

- misc.c unicode_fixup_string enhanced by an additional parameter to
define the fromcode
- misc.h unicode_fixup_string prototype updated
- filescanner.c function fixup_tags updated to stay compatible to the
previous implementation using fromcode "ascii"
- db.c function unicode_fixup_mfi updated to stay compatible to the
previous implementation using fromcode "ascii"
- http.c function metadata_header_get enhanced to encode the header
field-content as "ISO−8859−1" to comply with rfc2616
2015-05-31 14:05:31 +01:00
ejurgensen
dccbe92a75 Only do hex conversion if param is 0x-format. Also accept song-spec from Retune (issue #90). 2015-01-26 22:37:02 +01:00
ejurgensen
65110a9f39 Fix FreeBSD sound timing problems 2014-09-27 22:59:19 +02:00
ejurgensen
21cf3ab7d3 Add trimwhitespace(), keyval sorting and alloc to misc functions
- features required by the LastFM module
2014-08-15 22:56:39 +02:00
ejurgensen
258163e6ce hi-res timer commit broke FreeBSD. This attempts to go back to the
old code for FreeBSD.
2014-02-08 22:59:07 +01:00
Justin Maggard
0ec6e2f072 Extend support for kernels without high-res timers to 64-bit platforms. 2014-02-05 18:15:17 -08:00
Anthony Doko
949cf3808d Add support for embedded platforms that don't have high-res timers. 2014-02-05 18:11:10 -08:00
Julien BLACHE
75dc4106a8 Remove byte-order mark from UTF-8 strings
The byte-order marks are useless for UTF-8, but that doesn't mean we don't
find them in the wild. Get rid of them, they confuse the hell out of the
collation functions.

Reported by Kai Elwert.
2011-04-30 18:59:29 +02:00
Julien BLACHE
2be812e04d Fix 32bit MurmurHash64 routines
Properly handle the tail of the data buffer, accessing the tail as an
unsigned char array instead of a uint32_t array.

Issue spotted by Peter Carmichael.
2010-10-23 18:36:10 +02:00
Julien BLACHE
33d51f0652 Add key/value functions & data types 2010-09-18 17:24:33 +02:00
Julien BLACHE
da0c10a392 Add unicode_fixup_string() to check & reencode UTF-8 strings 2010-06-21 17:50:09 +02:00
Julien BLACHE
f38ff924d7 Add safe_hextou32() 2010-05-05 19:13:15 +02:00
Julien BLACHE
49b7a96eec Add safe_hextou64() 2010-05-02 11:44:43 +02:00
Julien BLACHE
7a02215d0d Add Base64 encoding routines 2010-05-02 11:44:43 +02:00
Ace Jones
20d08d8a49 Add safe_atou32() and safe_atou64() 2010-02-10 18:21:32 +01:00