Commit Graph

52 Commits

Author SHA1 Message Date
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
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
Scott Shambarger
ce4ef0aa23 [config] Many updates to configuration and feature checks
- Added custom checks for libraries and pkgconfig modules that test library
 presence with additional checks for use of headers and functions with
 given options.  Also support correct additional feature library checks
 using provided flags.
- Added custom enable/disable feature macros to simplify their use.
- Use custom CFLAGS and LIBS variables for Makefiles to simplify maintenance.
- Update many feature checks from platform to function.
- Streamline many function checks.
- Correctly check gnutls, gcrypt and gpg-error libraries.
- Fix chromecast and spotify config and compile on FreeBSD
- Added inotify, signalfd and kqueue, and byte swap checks.
- Many clarifications of error messages.
- Correct json-c checks to properly use supplied CFLAGS.
- Correct many quoting inconsistencies
- Use __DATE__ in place of BUILDDATE
- Use full path for gperf and antlr3
- Remove unnecessary CFLAGS
- Added tests for pthread_setname_np parameters
- Added tests for clock_gettime and timer_settime
- Added tests for time.h
- Test if pthread, dl and rt libs are required/available.
- Updated checks for libunistring
2017-01-06 00:44:18 -08: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
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
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
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
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
Julien BLACHE
58faeaceca Integer types cleanup
Try to be a bit more strict about integer types, use off_t or int64_t for
file size and file offsets.

Replace safe_ato*() by safe_atoi32() and safe_atoi64(), fix integer types
at call sites to match.
2010-02-02 21:09:56 +01:00
Ace Jones
e948f69d0d Add safe_atoull() 2010-01-10 12:09:29 +01:00
Julien BLACHE
b9d8a5880a Introduce m_realpath() to replace realpath(path, NULL) 2010-01-09 13:43:29 +01:00
Julien BLACHE
8ef57bbb41 Add the MurmurHash2, 64bit version
Hash algorithm by Austin Appleby, <http://murmurhash.googlepages.com>
2010-01-04 17:58:28 +01:00
Julien BLACHE
cd636cf42d Add base64 decoding routine 2009-05-03 11:16:57 +02:00